2020-04-20 01:31:46 -04:00
|
|
|
/* eslint-env node, es6 */
|
|
|
|
|
2015-06-25 14:54:19 -04:00
|
|
|
module.exports = function ( grunt ) {
|
2017-01-23 10:14:01 -05:00
|
|
|
var conf = grunt.file.readJSON( 'skin.json' );
|
2020-04-20 01:31:46 -04:00
|
|
|
|
2015-06-25 14:54:19 -04:00
|
|
|
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
2017-01-23 10:14:01 -05:00
|
|
|
grunt.loadNpmTasks( 'grunt-eslint' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-stylelint' );
|
2019-02-07 01:25:33 -05:00
|
|
|
grunt.loadNpmTasks( 'grunt-svgmin' );
|
|
|
|
|
2015-06-25 14:54:19 -04:00
|
|
|
grunt.initConfig( {
|
2017-01-23 10:14:01 -05:00
|
|
|
eslint: {
|
2019-03-13 18:57:00 -04:00
|
|
|
options: {
|
2020-04-20 01:31:46 -04:00
|
|
|
extensions: [ '.js', '.json' ],
|
2019-03-13 18:57:00 -04:00
|
|
|
cache: true
|
|
|
|
},
|
2017-01-23 10:14:01 -05:00
|
|
|
all: [
|
2020-04-20 01:31:46 -04:00
|
|
|
'*.{js,json}',
|
|
|
|
'**/*.{js,json}',
|
2017-08-03 09:02:59 -04:00
|
|
|
'!node_modules/**',
|
|
|
|
'!vendor/**'
|
2015-06-25 14:54:19 -04:00
|
|
|
]
|
2017-01-23 10:14:01 -05:00
|
|
|
},
|
|
|
|
banana: conf.MessagesDirs,
|
|
|
|
stylelint: {
|
|
|
|
options: {
|
|
|
|
syntax: 'less'
|
|
|
|
},
|
|
|
|
all: [
|
2020-04-20 01:31:46 -04:00
|
|
|
'**/*.{css,less}',
|
2017-08-03 09:02:59 -04:00
|
|
|
'!node_modules/**',
|
|
|
|
'!vendor/**'
|
2017-01-23 10:14:01 -05:00
|
|
|
]
|
2019-02-07 01:25:33 -05:00
|
|
|
},
|
|
|
|
// 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'
|
|
|
|
} ]
|
|
|
|
}
|
2015-06-25 14:54:19 -04:00
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
2019-02-07 01:25:33 -05:00
|
|
|
grunt.registerTask( 'minify', 'svgmin' );
|
2020-04-20 01:31:46 -04:00
|
|
|
grunt.registerTask( 'test', [ 'eslint', 'banana', 'stylelint' ] );
|
2019-02-07 01:25:33 -05:00
|
|
|
grunt.registerTask( 'default', [ 'minify', 'test' ] );
|
2015-06-25 14:54:19 -04:00
|
|
|
};
|