0.4.3 • Published 11 months ago

@castiron/webpack-config-factory v0.4.3

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

CIC Webpack Config Factory

A single webpack configuration for CIC projects.

Supported CMS

  • October
  • Wordpress

Install Instructions

  1. yarn add @castiron/webpack-config-factory
  2. If there are any existing webpack config files, delete them.
  3. Copy the contents of the /samples directory into your project somewhere and update as needed.
  4. Add a babel preset to package.json if desired.
  "babel": {
    "presets": [
      "react-app"
    ]
  },
  1. Add a browserslist definition to package.json if one is not already there.
"browserslist": [
  "defaults"
],
  1. 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

  1. In this repo, run yarn link.
  2. In your project, run yarn link @castiron/webpack-config-factory.