This is a tracking issue for extracting a shared config that can be used as a package.
Known tasks:
webpack.config.js
file into smaller pieces./packages/calypso-webpack
(or similar folder name) and we at first just import them from there to main config.webpack.config.js
config, but we'll need to turn them into functions that can take parameters. So minification function should have minify=true
parameter rather than NODE_ENV=production
etc. _.merge
?)webpack.env.js
? All runtime configuration config should come from this single module, providing a single place to consult defaults and a single source of truth.Related: webpack has an experimental PR for presets: ability to split the config into modules and compose presets together.
The PR has been rather inactive for the last year, but still good to know about. We might reuse some ideas on how to split and combine config bits together?
This is all done except for the bits needed in https://github.com/Automattic/jetpack/issues/11745
Most helpful comment
Related: webpack has an experimental PR for presets: ability to split the config into modules and compose presets together.
The PR has been rather inactive for the last year, but still good to know about. We might reuse some ideas on how to split and combine config bits together?