Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
utWebpack
✓ const utWebpack = require('ut-webpack')
✗ import utWebpack from 'ut-webpack'
Package is CommonJS only as of v9; ESM import not supported.
default (module.exports)
✓ module.exports = ({utWebpack}) => ({ options: {...}, use: [utWebpack({...})] })
✗ export default function({utWebpack}) {...}
Export must be a function that receives a destructured object with utWebpack property. Do not use ES module syntax.
utWebpack function options
✓ utWebpack({ publicPath: '/my/path/' })
✗ utWebpack.publicPath('/my/path/')
Options are passed as an object to the function, not as method calls.
Setup of ut-webpack with a configuration file and usage via CLI.
// Install globally: npm install -g ut-webpack
// Create utWebpack.js in project root:
const path = require('path');
module.exports = ({utWebpack}) => ({
options: {
mains: {
admin: 'admin',
service: 'service'
},
publicPath: '/a/browser/',
source: 'browser',
output: path.resolve('dist'),
proxy: {
context: ['!/a/browser/**'],
target: 'http://localhost:8004'
}
},
use: [utWebpack({cssImport: path.resolve('impl/browser/config')})]
});
// Then use CLI: ut-webpack --mode production or ut-webpack-dev-server --mode development
Errors
Common errors & fixes
Cannot find module 'neutrino'
Neutrino is not installed as a peer dependency.
fixInstall neutrino: npm install neutrino --save-dev
ut-webpack: command not found
ut-webpack is not installed globally or locally in node_modules/.bin.
fixInstall globally: npm install -g ut-webpack, or use npx ut-webpack.
TypeError: utWebpack is not a function
utWebpack was imported incorrectly or the config file export is wrong.
fixEnsure correct import: const utWebpack = require('ut-webpack'); and the exported function calls utWebpack as a function. Audit
Dependencies
neutrinorequiredut-webpack is a Neutrino preset; requires Neutrino to function.
webpackrequiredUnderlying bundler; Neutrino wraps webpack.
csp-html-webpack-pluginoptionalUsed for content security policy when 'csp' option is provided.
html-webpack-pluginoptionalUsed for HTML generation when 'html' option is provided.