@castiron/webpack-config-factory
v0.4.4-beta.1
Published
A single webpack configuration for CIC projects.
Downloads
165
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
/samples
directory into your project somewhere and update as needed. - Add a babel preset to
package.json
if desired.
"babel": {
"presets": [
"react-app"
]
},
- Add a browserslist definition to
package.json
if one is not already there.
"browserslist": [
"defaults"
],
- Update your scripts in
package.json
if 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
.