mediawiki-extensions-Multim.../Gruntfile.js
Volker E a23084a360 build: Follow 'svgmin' step option best-practices
Changing indentation to tabs and use `multipass` option correctly.
Follow-up to I09660b9d49cfdc4.

Change-Id: Ic69532ad165c34aab97888328c7bef6e6c578491
2018-11-28 18:32:16 -08:00

76 lines
1.4 KiB
JavaScript

/* eslint-env node */
module.exports = function ( grunt ) {
var conf = grunt.file.readJSON( 'extension.json' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.loadNpmTasks( 'grunt-svgmin' );
grunt.initConfig( {
banana: conf.MessagesDirs,
jsonlint: {
all: [
'**/*.json',
'!node_modules/**',
'!vendor/**'
]
},
eslint: {
all: [
'*.js',
'resources/mmv/**/*.js',
'tests/**/*.js'
]
},
stylelint: {
options: {
syntax: 'less'
},
src: 'resources/mmv/**/*.{css,less}'
},
// Image Optimization
svgmin: {
options: {
js2svg: {
// eslint-disable-next-line no-tabs
indent: ' ',
pretty: true
},
multipass: true,
plugins: [ {
cleanupIDs: false
}, {
removeDesc: false
}, {
removeRasterImages: true
}, {
removeTitle: false
}, {
removeViewBox: false
}, {
removeXMLProcInst: false
}, {
sortAttrs: true
} ]
},
all: {
files: [ {
expand: true,
cwd: 'resources',
src: [
'**/*.svg'
],
dest: 'resources/',
ext: '.svg'
} ]
}
}
} );
grunt.registerTask( 'test', [ 'eslint', 'stylelint', 'svgmin', 'jsonlint', 'banana' ] );
grunt.registerTask( 'default', 'test' );
};