mediawiki-extensions-Popups/package.json
Volker E f47e333ff1 build: Bring SVGO optimization to build step
Enabling SVGO automation with 'grunt-svgmin' and conservative
plugin settings to build step, among those:
- enable removeRasterImages and sortAttrs,
- disable cleanupIDs, removeDesc, removeTitle, & removeViewBox as
  described in
  https://www.mediawiki.org/wiki/Manual:Coding_conventions/SVG#Exemplified_safe_configuration
- disable removeXMLProcInst; if the SVG doesn't start with an XML
  declaration, then it's MIME type will be detected as "text/plain"
  rather than "image/svg+xml" by libmagic and, consequently, MediaWiki's
  CSSMin CSS minifier. libmagic's default database currently requires
  that SVGs contain an XML declaration:
  <https://github.com/threatstack/libmagic/blob/master/magic/Magdir/sgml#L5>.
- make use of pretty and multipass options.

Settings are stored in a JSON file to be independent of the Grunt build
process. Also updating SVG accordingly.

Bug: T185596
Change-Id: I715ad4cf2e900665e4c32c78b4c2d9d9cebf0222
2018-08-01 10:51:43 -05:00

48 lines
1.5 KiB
JSON

{
"private": true,
"scripts": {
"start": "webpack -dw",
"build": "NODE_ENV=production webpack -p",
"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",
"check-built-assets": "echo 'CHECKING BUILD SOURCES ARE COMMITTED OR STAGED' && npm -s run build && git diff -q resources/dist",
"coverage": "SPAWN_WRAP_SHIM_ROOT=\"$PWD/.nyc_output\" nyc npm -s run test:node",
"precommit": "npm -s t"
},
"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.6.0",
"grunt": "1.0.2",
"grunt-banana-checker": "0.6.0",
"grunt-contrib-watch": "1.0.1",
"grunt-eslint": "20.1.0",
"grunt-jsonlint": "1.1.0",
"grunt-stylelint": "0.10.0",
"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",
"webpack": "4.1.1",
"webpack-cli": "2.0.12"
},
"bundlesize": [
{
"path": "resources/dist/index.js",
"maxSize": "12.1KB"
}
]
}