@financial-times/dotcom-build-base
v11.2.1
Published
The Page Kit CLI
Downloads
2,330
Maintainers
Keywords
Readme
@financial-times/dotcom-build-base
This package exports a Webpack plugin to configure it with the ability to build client-side assets to Page Kit conventions.
Getting started
This package is compatible with Node 12+ and is distributed on npm.
npm install --save-dev @financial-times/dotcom-build-base
After installing the module you must add it to the list of plugins in your project's webpack.config.js
configuration file:
const { PageKitBasePlugin } = require('@financial-times/dotcom-build-base');
module.exports = {
plugins: [
new PageKitBasePlugin()
]
}
This package enhances your Webpack config to do:
- Basic Javascript compilation and bundling
- Brotli and gzip compression of output files
- Generating a manifest of the output files for other tools such as
dotcom-server-asset-loader
to consume - Cleaning up out-of-date output files
Development and production modes
In production mode the generated output will be optimised, file names hashed, and full source maps, gzip and brotli compressed assets generated. Production mode is the default.
To enable development mode you can use the --mode
Webpack flag. This will disable several optimisations in favour of providing faster builds and rebuilds. See the Webpack mode documentation for further information about modes.
webpack --mode=development