Webpack 4.7 is available in experimental.

TODO

  1. Run tests (currently disabled because jest is not packaged).
  2. Package or embed @webassemblyjs/* to update to newer webpack releases.

Major changes

  1. Now entry, output options on command line are mandatory and we get a warning if mode option is not specified. Check node-d3-request (commit)

  2. production and development are new modes and each has its on default options. production mode does minify by default.

  3. entry option in command line must have ./ prefix to directory path (--entry src/index.js will not work, but --entry ./src/index.js will work). See node-turbolinks commit.

  4. node_modules/.cache should be removed in clean target.

  5. node-grunt-webpack should be >= 3.1.

  6. webpack.optimize.UglifyJsPlugin has been removed, please use config.optimization.minimize instead. Check this patch or this commit (where a single config file creates multiple output files and only one of them we need minimized).

Steps to build with webpack 4

  1. clone repo from salsa (gbp clone --pristine-tar)

  2. Update debian/control and change webpack dependency to >= 4~ to force building with webpack 4 (without this, package in unstable will be used).

  3. Build on experimental. See sbuild#Enabling_experimental

Involved packages

Command used to find the list: reverse-depends -b webpack

Already compatible with webpack 4

Ready in unstable

Ready in experimental

Ready in git

Ready with patch in BTS

Need fix - solved in other packages

In progress - need help

webpack --progress --colors
/usr/share/nodejs/webpack/node_modules/webpack-cli/bin/cli.js:93
                                throw err;
                                ^

Error: Options {"loose":true} passed to /usr/lib/nodejs/babel-preset-env/lib/index.js which does not accept options. (While processing preset: "/usr/lib/nodejs/babel-preset-env/lib/index.js") (While processing preset: "/usr/lib/nodejs/babel-preset-env/lib/index.js")
    at /usr/lib/nodejs/babel-core/lib/transformation/file/options/option-manager.js:314:17

webpack -d --output-filename json-document.js Invalid configuration object. 
Webpack has been initialised using a configuration object that does not match the API schema. - configuration.module has an unknown property 'loaders'. 
These properties are valid: object { exprContextCritical?, 
exprContextRecursive?, exprContextRegExp?, exprContextRequest?, noParse?, 
rules?, defaultRules?, unknownContextCritical?, unknownContextRecursive?, 
unknownContextRegExp?, unknownContextRequest?, unsafeCache?, 
wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp?, 
strictExportPresence?, strictThisContextOnImports? }
-> Options affecting the normal modules (`NormalModuleFactory`).

In progress

Supported in new upstream release

Not checked

Packages that needs to move to unstable with webpack 4