The default of `path` and `sourceMapFilename` are already what we want,
no need to set them explicitly.
The `output.filename` is already `[name].js`, and it's totally not
important to name the file differently in production mode (it will then
just be `index.js.gz`, compared to index.js in development mode).
node-sass is a compiled ELF module, which is problematic for
distributions that want to rebuild everything from source. The sassc CLI
program is packaged everywhere, and both use the same libsass library.
So drop node-sass and sass-loader, and replace it with a simple loader
wrapper around sassc.
This also saves 122 npm packages (16 MB in node_modules/).
Closes#382
compression-webpack-plugin fixes https://www.npmjs.com/advisories/1548
Adjust to new copy-webpack-plugin API.
Thew new modules now create dist/index.html.gz in `NODE_ENV=production`
mode, so switch `WEBPACK_TEST` to index.css instead (which remains
uncompressed in both modes).
This recently started to overflow inotify, and we don't need that --
it's fine to restart webpack when changing package.json, and it happens
rarely enough.
Closes#345
* Stop importing cockpit's base1/patternfly.css
This is deprecated API and will be dropped at some point, in favor
of projects shipping their own CSS.
Install and import the styles from PF4 now.
* Use webpack based string replacement for removing the font-face rules from PF4
Doing the seddery in Makefile breaks `npm run build`, webpack watching,
and is generally brittle.
Do the font replacement hacking with `string-replace-loader`, which fits into webpack much more nicely.
There is still some potential simplification by not duplicating the
entire scss loader chain.
Co-authored-by: Martin Pitt <[email protected]>
Closes#315
It looks like Webpack is deprecating extract-text-webpack-plugin in favor of
mini-css-extract-plugin.
Discussion can be found here: webpack-contrib/extract-text-webpack-plugin#731
Closes#271
eslint is much more powerful and flexible than jshint, and we don't want
to promote writing new projects with pre-ES6 code.
As a side effect, this also avoids downloading PhantomJS (see
https://github.com/jshint/jshint/issues/3318), thereby cutting down
node_modules/ from 470 MB to 210 MB.