Registry / web-framework / ut-webpack

ut-webpack

JSON →
library9.1.1jsnpmunverified

A Neutrino-based preset for the UT framework, providing shared Webpack configuration for building and developing frontend applications. Current stable version is 9.1.1. It simplifies setup by offering pre-configured build and dev server scripts, with options for customizing public path, source, output, proxy, CSS imports, and content security policy. Release cadence is tied to UT framework updates. Key differentiators: integrates tightly with Neutrino and UT ecosystem, supports multiple entry points (mains) out of the box.

npm install ut-webpack
INSTALL
IMPORT
SIG · UT-WEBPACK
U
ut-webpack
web-frameworkjavascriptv9.1.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
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
musl
node 18226 runs
build_error
glibc
node 18226 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
Debug
Known issues
gotchaut-webpack must be installed globally for the CLI commands (ut-webpack, ut-webpack-dev-server) to work.
fix
Install globally: npm install -g ut-webpack. Alternatively, use npx or add to package.json scripts.
affects: >=1.0.0
gotchaThe configuration file must export a function, not an object, because the preset system expects a factory.
fix
Use: module.exports = ({utWebpack}) => ({...});
affects: >=1.0.0
gotchaIf 'cssImport' option is set, the path must exist; otherwise postcss-import will fail silently.
fix
Ensure the directory exists, e.g., path.resolve('impl/browser/config').
affects: >=1.0.0
gotchaThe dev server proxy context uses a negative pattern to exclude static assets; misconfiguration can cause proxy errors.
fix
Verify proxy context array and target URL. Default context: ['!/a/browser/**'].
affects: >=1.0.0
Errors
Common errors & fixes
Cannot find module 'neutrino'
Neutrino is not installed as a peer dependency.
fix
Install neutrino: npm install neutrino --save-dev
ut-webpack: command not found
ut-webpack is not installed globally or locally in node_modules/.bin.
fix
Install 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.
fix
Ensure correct import: const utWebpack = require('ut-webpack'); and the exported function calls utWebpack as a function.
Upgrade
Version history
9.1.1latest on npm
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.
Agent activity
10 hits · last 30 days
node
8
Resources
ut-webpack — npm install ut-webpack · libregistry