{"id":20648,"library":"ut-webpack","title":"ut-webpack","description":"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.","status":"active","version":"9.1.1","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/softwaregroup-bg/ut-webpack","tags":["javascript"],"install":[{"cmd":"npm install ut-webpack","lang":"bash","label":"npm"},{"cmd":"yarn add ut-webpack","lang":"bash","label":"yarn"},{"cmd":"pnpm add ut-webpack","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"ut-webpack is a Neutrino preset; requires Neutrino to function.","package":"neutrino","optional":false},{"reason":"Underlying bundler; Neutrino wraps webpack.","package":"webpack","optional":false},{"reason":"Used for content security policy when 'csp' option is provided.","package":"csp-html-webpack-plugin","optional":true},{"reason":"Used for HTML generation when 'html' option is provided.","package":"html-webpack-plugin","optional":true}],"imports":[{"note":"Package is CommonJS only as of v9; ESM import not supported.","wrong":"import utWebpack from 'ut-webpack'","symbol":"utWebpack","correct":"const utWebpack = require('ut-webpack')"},{"note":"Export must be a function that receives a destructured object with utWebpack property. Do not use ES module syntax.","wrong":"export default function({utWebpack}) {...}","symbol":"default (module.exports)","correct":"module.exports = ({utWebpack}) => ({ options: {...}, use: [utWebpack({...})] })"},{"note":"Options are passed as an object to the function, not as method calls.","wrong":"utWebpack.publicPath('/my/path/')","symbol":"utWebpack function options","correct":"utWebpack({ publicPath: '/my/path/' })"}],"quickstart":{"code":"// Install globally: npm install -g ut-webpack\n// Create utWebpack.js in project root:\nconst path = require('path');\nmodule.exports = ({utWebpack}) => ({\n  options: {\n    mains: {\n      admin: 'admin',\n      service: 'service'\n    },\n    publicPath: '/a/browser/',\n    source: 'browser',\n    output: path.resolve('dist'),\n    proxy: {\n      context: ['!/a/browser/**'],\n      target: 'http://localhost:8004'\n    }\n  },\n  use: [utWebpack({cssImport: path.resolve('impl/browser/config')})]\n});\n// Then use CLI: ut-webpack --mode production or ut-webpack-dev-server --mode development","lang":"javascript","description":"Setup of ut-webpack with a configuration file and usage via CLI."},"warnings":[{"fix":"Install globally: npm install -g ut-webpack. Alternatively, use npx or add to package.json scripts.","message":"ut-webpack must be installed globally for the CLI commands (ut-webpack, ut-webpack-dev-server) to work.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use: module.exports = ({utWebpack}) => ({...});","message":"The configuration file must export a function, not an object, because the preset system expects a factory.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Ensure the directory exists, e.g., path.resolve('impl/browser/config').","message":"If 'cssImport' option is set, the path must exist; otherwise postcss-import will fail silently.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Verify proxy context array and target URL. Default context: ['!/a/browser/**'].","message":"The dev server proxy context uses a negative pattern to exclude static assets; misconfiguration can cause proxy errors.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Install neutrino: npm install neutrino --save-dev","cause":"Neutrino is not installed as a peer dependency.","error":"Cannot find module 'neutrino'"},{"fix":"Install globally: npm install -g ut-webpack, or use npx ut-webpack.","cause":"ut-webpack is not installed globally or locally in node_modules/.bin.","error":"ut-webpack: command not found"},{"fix":"Ensure correct import: const utWebpack = require('ut-webpack'); and the exported function calls utWebpack as a function.","cause":"utWebpack was imported incorrectly or the config file export is wrong.","error":"TypeError: utWebpack is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}