mediawiki-skins-Insurgency/Gruntfile.js
libraryupgrader ba7498328f build: Updating npm dependencies
* stylelint-config-wikimedia: 0.7.0 → 0.8.0
* grunt-stylelint: 0.12.0 → 0.13.0

Additional changes:
* Removing manual reportUnusedDisableDirectives for eslint.

Change-Id: I7a28154ee5fc73437c4cb4868fec2c296d642b2f
2020-01-07 17:43:21 +00:00

83 lines
1.5 KiB
JavaScript

/* eslint-env node */
module.exports = function ( grunt ) {
var conf = grunt.file.readJSON( 'skin.json' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.loadNpmTasks( 'grunt-svgmin' );
grunt.initConfig( {
eslint: {
options: {
cache: true
},
all: [
'*.js',
'**/*.js',
'!node_modules/**',
'!vendor/**'
]
},
jsonlint: {
all: [
'*.json',
'**/*.json',
'!node_modules/**',
'!vendor/**'
]
},
banana: conf.MessagesDirs,
stylelint: {
options: {
syntax: 'less'
},
all: [
'*.{le,c}ss',
'**/*.{le,c}ss',
'!node_modules/**',
'!vendor/**'
]
},
// SVG 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/images',
src: [
'**/*.svg'
],
dest: 'resources/images/',
ext: '.svg'
} ]
}
}
} );
grunt.registerTask( 'minify', 'svgmin' );
grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'banana', 'stylelint' ] );
grunt.registerTask( 'default', [ 'minify', 'test' ] );
};