Commit graph

21 commits

Author SHA1 Message Date
Martin Pitt
8ea62cb4d7 webpack: Drop unnecessary output settings
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).
2020-11-26 11:17:04 +01:00
Martin Pitt
233b5cfe04 Use sassc instead of node-sass
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
2020-10-28 14:49:52 +01:00
Martin Pitt
a5ade152a8 npm: Upgrade webpack related development dependencies
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).
2020-09-28 07:49:01 +02:00
Martin Pitt
49a721354c
Exclude node_modules from webpack watching
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
2020-07-23 18:04:54 +02:00
Martin Pitt
f2a11ba1de
npm: Bump development dependencies
Closes #334
2020-06-29 22:16:55 +02:00
Katerina Koukiou
96514e279e
main: Stop importing patternfly.css
* 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
2020-05-28 10:01:31 +02:00
Matej Marusak
23e8eb1591 Replace 'extract-text-webpack-plugin' with 'mini-css-extract-plugin'
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
2020-01-27 21:16:30 +01:00
Martin Pitt
1fc1923021 Rename *.es6 to *.js
*.es6 isn't standard naming, that was just an old cockpit-ism. All files
are treated as ES6.
2019-07-17 17:43:01 +02:00
Martin Pitt
eea86c986f Explicitly specify browser compatibility in babel
We do this in cockpit and cockpit-ostree.
2019-07-17 17:43:01 +02:00
Martin Pitt
8a73531374 Use full React instead of react-lite
This is the direction we are going in Cockpit, as react-lite falls
behind with API development and debuggability.

Closes #43
2018-08-29 00:40:16 +02:00
Martin Pitt
842a380766 Move to webpack 4
This has uglification built in.

Closes #42
2018-08-29 00:37:18 +02:00
Martin Pitt
3922333029 Use eslint for everything
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.
2018-08-28 22:57:52 +02:00
Lars Karlitski
7260f5c01f Add scss example
Closes #26
2018-06-22 11:15:57 +02:00
Lars Karlitski
ce7a2d3870 Remove the index.js indirection
Make index.es6 the main entry point.
2017-10-18 16:42:54 +02:00
Lars Karlitski
dd765787e8 Remove all remaining mentions of "subscriptions" 2017-10-18 16:42:54 +02:00
Dominik Perpeet
26a7c0154c Compress distributed files 2017-07-26 10:33:14 +02:00
Dominik Perpeet
23f2f16715 Automatically minify js files for distribution 2017-07-26 10:33:14 +02:00
Dominik Perpeet
a01820e565 Add more sample content to subscriptions page 2017-07-26 10:33:14 +02:00
Dominik Perpeet
2f49b57064 Add sample page 2017-06-20 07:41:52 -04:00
Dominik Perpeet
3f7ac60374 build: Update webpack config
Make building more convenient, add linting and distribute html files.
2017-06-20 07:41:52 -04:00
Sean Toner
811e3eebe0 initial commit. Created a basic webpack.config.js file, some basic .babelrc settings, and some notes on the build 2017-06-20 07:41:52 -04:00