mediawiki-skins-Insurgency/Gruntfile.js
James D. Forrester 2926c08ada build: Replace jsonlint with eslint's JSON parsing
Change-Id: I75601793639653bcf46af13e259cafba80b81af4
2020-04-21 18:55:00 +00:00

76 lines
1.4 KiB
JavaScript

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