mediawiki-extensions-Multim.../Gruntfile.js
Ed Sanders 18a154b989 build: Update devDependencies
Change-Id: I46f5317976ef9f818e30b0c81018e83800535389
2019-07-31 22:59:13 +01:00

71 lines
1.3 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-stylelint' );
grunt.loadNpmTasks( 'grunt-svgmin' );
grunt.initConfig( {
banana: conf.MessagesDirs,
eslint: {
options: {
reportUnusedDisableDirectives: true,
extensions: [ '.js', '.json' ],
cache: true
},
all: [
'**/*.{js,json}',
'!{vendor,node_modules,docs}/**'
]
},
stylelint: {
options: {
syntax: 'less'
},
src: 'resources/mmv/**/*.{css,less}'
},
// Image Optimization
svgmin: {
options: {
js2svg: {
indent: '\t',
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', 'banana' ] );
grunt.registerTask( 'default', 'test' );
};