2019-06-04 07:06:35 +00:00
|
|
|
/* eslint-env node, es6 */
|
2016-04-19 12:45:09 +00:00
|
|
|
module.exports = function ( grunt ) {
|
2017-01-23 14:06:05 +00:00
|
|
|
var conf = grunt.file.readJSON( 'extension.json' );
|
|
|
|
|
2016-04-19 12:45:09 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
2016-09-01 11:17:47 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-eslint' );
|
2016-06-30 20:21:10 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-stylelint' );
|
2020-04-15 11:17:42 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-svgmin' );
|
2016-04-19 12:45:09 +00:00
|
|
|
|
|
|
|
grunt.initConfig( {
|
2016-09-01 11:17:47 +00:00
|
|
|
eslint: {
|
2019-02-10 16:54:28 +00:00
|
|
|
options: {
|
2019-06-04 07:06:35 +00:00
|
|
|
extensions: [ '.js', '.json' ],
|
2019-04-03 23:24:14 +00:00
|
|
|
cache: true
|
2019-02-10 16:54:28 +00:00
|
|
|
},
|
2016-09-01 11:17:47 +00:00
|
|
|
all: [
|
2019-12-11 13:42:51 +00:00
|
|
|
'**/*.{js,json}',
|
2019-06-04 07:06:35 +00:00
|
|
|
'!{vendor,node_modules}/**'
|
2016-09-01 11:17:47 +00:00
|
|
|
]
|
|
|
|
},
|
2016-06-30 20:21:10 +00:00
|
|
|
stylelint: {
|
|
|
|
all: [
|
2017-06-29 13:32:05 +00:00
|
|
|
'**/*.css',
|
2017-10-27 11:03:47 +00:00
|
|
|
'**/*.less',
|
2019-06-04 07:06:35 +00:00
|
|
|
'!{vendor,node_modules}/**'
|
2016-06-30 20:21:10 +00:00
|
|
|
]
|
2016-05-18 13:34:49 +00:00
|
|
|
},
|
2020-04-15 11:17:42 +00:00
|
|
|
banana: conf.MessagesDirs,
|
|
|
|
// 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',
|
|
|
|
src: [
|
|
|
|
'**/*.svg'
|
|
|
|
],
|
|
|
|
dest: 'resources/',
|
|
|
|
ext: '.svg'
|
|
|
|
} ]
|
|
|
|
}
|
|
|
|
}
|
2016-04-19 12:45:09 +00:00
|
|
|
} );
|
|
|
|
|
2020-04-15 11:17:42 +00:00
|
|
|
grunt.registerTask( 'minify', 'svgmin' );
|
2019-06-04 07:06:35 +00:00
|
|
|
grunt.registerTask( 'test', [ 'eslint', 'stylelint', 'banana' ] );
|
2016-04-19 12:45:09 +00:00
|
|
|
grunt.registerTask( 'default', 'test' );
|
|
|
|
};
|