Opinionated webpack 5 defaults for Canopy micro-frontend services. Current stable version 4.4.3, maintained primarily for internal Canopy use. Provides automatic AMD output, externals for common dependencies (react, react-dom, luxon, react-hook-form, @canopytax/*), babel-loader integration, and bundle analysis via webpack-bundle-analyzer. Differentiator: handles sofe service externals out of the box, supports TypeScript via object option, and remains fully overrideable without ejecting. Release cadence is irregular, driven by internal needs. Requires webpack 5, babel-loader, @babel/runtime, @babel/plugin-transform-runtime.
npm install canopy-webpack-configVerified import paths — ran on the pinned version, not inferred.
Creates a webpack configuration for a Canopy service with custom CSS rule and output path, overriding defaults.
If using webpack-dev-server, update scripts to use 'webpack serve' instead of 'webpack-dev-server'. Remove any references to unused-files-webpack-plugin.
Change { typescript: true } to { typescript: {} } or pass a configuration object.Add babel-loader, css-loader, etc. as devDependencies in your project and configure them in the override config.
Export the result of calling canopyWebpackConfig(name, overrides), not the function itself.
Upgrade to v4.1.1 or later.
Create a file at src/externals.ts (or .js) that exports an array of external module names, or disable the externals feature by not including it in your config.
Use const canopyWebpackConfig = require('canopy-webpack-config'); and then call it as a function.Run yarn add --dev babel-loader or npm install --save-dev babel-loader.