mediawiki-extensions-Popups/package.json
Stephen Niedzielski a24bbe76e6 Hygiene: use source-maps for dev builds not eval maps
Webpack's `-d` option is an alias for
`--debug --devtool cheap-module-eval-source-map --output-pathinfo`[0]
which overrode the `devtool` specified in the config. Specify
`--mode=development` which appears to be better supported than `-d`,
although the distinction is poorly documented[1]. The build products are
identical for `--mode=development --debug --output-pathinfo` and simply
`--mode=development` so the latter is used.

For consistency, replace `-p`, an alias for
`--optimize-minimize --define process.env.NODE_ENV=production`[0],
where `--optimize-minimize` is documented[2] as:

  Minimize JavaScript and switches loaders to minimizing UglifyJsPlugin
  and LoaderOptionsPlugin.

With `--mode=production` which is documented[3] as:

  Sets process.env.NODE_ENV on DefinePlugin to value production. Enables
  FlagDependencyUsagePlugin, FlagIncludedChunksPlugin,
  ModuleConcatenationPlugin, NoEmitOnErrorsPlugin,
  OccurrenceOrderPlugin, SideEffectsFlagPlugin and UglifyJsPlugin.

This change has already been made to MobileFrontend in c10f87d89.

[0] https://webpack.js.org/api/cli/#shortcuts
[1] https://medium.com/webpack/webpack-4-released-today-6cdb994702d4#dfa8
[2] https://webpack.js.org/api/cli/#optimize-options
[3] https://webpack.js.org/concepts/mode/#usage

Change-Id: I7a7ffc913592f0b18e091bb219a7fc75873d4d7a
2018-11-16 13:17:46 -07:00

60 lines
2.1 KiB
JSON

{
"private": true,
"scripts": {
"start": "webpack -w --mode=development",
"build": "NODE_ENV=production webpack --mode=production",
"lint:fix": "grunt fix",
"test:node": "node tests/node-qunit/run.js 'tests/node-qunit/**/*.test.js' | tap-mocha-reporter dot",
"test": "npm -s run check-built-assets && grunt lint && npm -s run coverage && npm -s run -s doc && bundlesize",
"doc": "jsdoc -c jsdoc.json",
"node-debug": "node -v && npm -v && echo 'Please ensure you are running the correct version of nvm before running this command.'",
"check-built-assets": "echo 'CHECKING BUILD SOURCES ARE COMMITTED OR STAGED' && npm -s run build && git diff --exit-code resources/dist || { npm run node-debug; false; }",
"coverage": "SPAWN_WRAP_SHIM_ROOT=\"$PWD/.nyc_output\" nyc npm -s run test:node",
"precommit": "npm -s t",
"selenium-daily": "npm run selenium-test",
"selenium-test": "wdio tests/selenium/wdio.conf.js"
},
"engines": {
"node": "6.11.0"
},
"devDependencies": {
"@wikimedia/mw-node-qunit": "5.0.0",
"babel-loader": "7.1.4",
"babel-preset-env": "1.6.0",
"babel-register": "6.24.1",
"bundlesize": "0.15.3",
"clean-webpack-plugin": "0.1.19",
"eslint-config-wikimedia": "0.8.1",
"eslint-plugin-qunit": "3.3.1",
"grunt": "1.0.3",
"grunt-banana-checker": "0.6.0",
"grunt-contrib-watch": "1.0.1",
"grunt-eslint": "21.0.0",
"grunt-jsonlint": "1.1.0",
"grunt-stylelint": "0.10.1",
"grunt-svgmin": "5.0.0",
"husky": "0.13.3",
"jsdoc": "3.5.5",
"nyc": "12.0.2",
"redux": "3.6.0",
"redux-thunk": "2.2.0",
"stylelint": "9.2.0",
"stylelint-config-wikimedia": "0.4.3",
"svg-inline-loader": "0.8.0",
"tap-mocha-reporter": "3.0.7",
"wdio-junit-reporter": "0.4.4",
"wdio-mediawiki": "0.2.0",
"wdio-mocha-framework": "0.6.1",
"wdio-spec-reporter": "0.1.4",
"webdriverio": "4.13.1",
"webpack": "4.1.1",
"webpack-cli": "2.0.12"
},
"bundlesize": [
{
"path": "resources/dist/index.js",
"maxSize": "12.1KB"
}
]
}