f-build-scss
Webpack configuration for SCSS Builds
Quick Guide
This module essentially finds and generates an Array of webpack-chain config objects, which is returned when this module is called.
Ideally, we would use one webpack-chain object with multiple entry points (to avoid duplication), but due to a bug in Eyeglass this isn't possible (as it returns the same output for the multiple CSS outputs).
Example Usage
To run as part of a webpack build, the following gives an example of how the style config can be applied.
const styleConfig = require('@justeat/f-build-scss');
module.exports = (env, argv) => {
const rawStyleConfig = styleConfig.map(config => {
config
.mode(settings.returnMode(argv))
.output
.path(path.join(__dirname, 'wwwroot/hw'))
.publicPath('/');
return config.toConfig();
});
return [
...rawStyleConfig
];
};