mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-13 18:06:57 +00:00
2e27c9597b
Unifying code across projects. Change-Id: I78e07c4efab6a9c084cbba5944c24003dc30fcad
78 lines
1.4 KiB
JavaScript
78 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: {
|
|
options: {
|
|
reportUnusedDisableDirectives: true
|
|
},
|
|
all: [
|
|
'*.js',
|
|
'resources/mmv/**/*.js',
|
|
'tests/**/*.js'
|
|
]
|
|
},
|
|
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', 'jsonlint', 'banana' ] );
|
|
grunt.registerTask( 'default', 'test' );
|
|
};
|