mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-11 16:49:26 +00:00
dd87939792
Bug: T220036 Change-Id: I279f56b251c53aa5deee74185ece69b2150509bb
78 lines
1.3 KiB
JavaScript
78 lines
1.3 KiB
JavaScript
/*!
|
|
* Grunt file
|
|
*
|
|
* @package Cite
|
|
*/
|
|
|
|
/* eslint-env node, es6 */
|
|
|
|
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( {
|
|
eslint: {
|
|
options: {
|
|
reportUnusedDisableDirectives: true,
|
|
extensions: [ '.js', '.json' ],
|
|
cache: true
|
|
},
|
|
all: [
|
|
'**/*.js{,on}',
|
|
'!{vendor,node_modules}/**'
|
|
]
|
|
},
|
|
banana: conf.MessagesDirs,
|
|
stylelint: {
|
|
all: [
|
|
'**/*.css',
|
|
'**/*.less',
|
|
'!node_modules/**',
|
|
'!vendor/**'
|
|
]
|
|
},
|
|
// SVG Optimization
|
|
svgmin: {
|
|
options: {
|
|
js2svg: {
|
|
pretty: true,
|
|
multipass: true
|
|
},
|
|
plugins: [ {
|
|
cleanupIDs: false
|
|
}, {
|
|
removeDesc: false
|
|
}, {
|
|
removeRasterImages: true
|
|
}, {
|
|
removeTitle: false
|
|
}, {
|
|
removeViewBox: false
|
|
}, {
|
|
removeXMLProcInst: false
|
|
}, {
|
|
sortAttrs: true
|
|
} ]
|
|
},
|
|
all: {
|
|
files: [ {
|
|
expand: true,
|
|
cwd: 'modules/ve-cite/icons',
|
|
src: [
|
|
'**/*.svg'
|
|
],
|
|
dest: 'modules/ve-cite/icons/',
|
|
ext: '.svg'
|
|
} ]
|
|
}
|
|
}
|
|
} );
|
|
|
|
grunt.registerTask( 'test', [ 'eslint', 'stylelint', 'banana', 'svgmin' ] );
|
|
grunt.registerTask( 'default', 'test' );
|
|
};
|