@castiron/webpack-config-factory
v1.0.0
Published
A single webpack configuration for CIC projects.
Downloads
68
Keywords
Readme
CIC Webpack Config Factory
A single webpack configuration for CIC projects.
Supported CMS
- October
- Wordpress
Install Instructions
yarn add @castiron/webpack-config-factory- If there are any existing webpack config files, delete them.
- Copy the contents of the
/samplesdirectory into your project somewhere and update as needed. - Add a babel preset to
package.jsonif desired.
"babel": {
"presets": [
"react-app"
]
},- Add a browserslist definition to
package.jsonif one is not already there.
"browserslist": [
"defaults"
],- Update your scripts in
package.jsonif needed to use the new config files.
Migrating babel polyfill to core-js
@babel/polyfill is deprecated in favor of core-js.
@babel/polyfill used core-js under the hood, so the migration process is very straightforward.
-import "@babel/polyfill";
+import "core-js/stable";
+import "regenerator-runtime/runtime";Sample package.json scripts
"scripts": {
"dev": "NODE_ENV=development WEBPACK_DEV_SERVER=true webpack-dev-server --config config/webpack/dev.conf.js",
"watch": "NODE_ENV=development webpack --watch --config config/webpack/prod.conf.js",
"build": "NODE_ENV=production webpack --bail --config config/webpack/prod.conf.js",
}Development
- In this repo, run
yarn link. - In your project, run
yarn link @castiron/webpack-config-factory.
