mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 23:24:39 +00:00
Hygiene: replace deprecated Webpack plugin
Replace NamedModulesPlugin with `optimisations.namedModules = true`. Not to be confused with `optimization.namedModules` which is deprecated. https://github.com/webpack/webpack/releases/tag/v4.0.0 https://github.com/webpack/webpack/releases/tag/v4.16.0 Bug: T212527 Change-Id: Ie5c7b74e294b012f270de8a6ebc660bf5e75d478
This commit is contained in:
parent
f2c1e787bc
commit
c8c93d0859
|
@ -1,6 +1,6 @@
|
|||
/* global __dirname, process */
|
||||
const path = require( 'path' ),
|
||||
webpack = require( 'webpack' ),
|
||||
const
|
||||
path = require( 'path' ),
|
||||
CleanPlugin = require( 'clean-webpack-plugin' ),
|
||||
PUBLIC_PATH = '/w/extensions/Popups',
|
||||
isProduction = process.env.NODE_ENV === 'production';
|
||||
|
@ -38,7 +38,14 @@ const conf = {
|
|||
|
||||
optimization: {
|
||||
// Don't produce production output when a build error occurs.
|
||||
noEmitOnErrors: isProduction
|
||||
noEmitOnErrors: isProduction,
|
||||
|
||||
// Use filenames instead of unstable numerical identifiers for file references. This
|
||||
// increases the gzipped bundle size some but makes the build products easier to debug and
|
||||
// appear deterministic. I.e., code changes will only alter the bundle they're packed in
|
||||
// instead of shifting the identifiers in other bundles.
|
||||
// https://webpack.js.org/guides/caching/#deterministic-hashes (namedModules replaces NamedModulesPlugin.)
|
||||
namedModules: true
|
||||
},
|
||||
|
||||
output: {
|
||||
|
@ -61,12 +68,7 @@ const conf = {
|
|||
devtool: 'source-map',
|
||||
|
||||
plugins: [
|
||||
new CleanPlugin( distDir, { verbose: false } ),
|
||||
|
||||
// To generate identifiers that are preserved over builds, webpack supplies
|
||||
// the NamedModulesPlugin (generates comments with file names on bundle)
|
||||
// https://webpack.js.org/guides/caching/#deterministic-hashes
|
||||
new webpack.NamedModulesPlugin()
|
||||
new CleanPlugin( distDir, { verbose: false } )
|
||||
],
|
||||
|
||||
performance: {
|
||||
|
|
Loading…
Reference in a new issue