2017-01-23 10:14:01 -05:00
|
|
|
/* eslint-env node */
|
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' );
|
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' );
|
2015-06-25 14:54:19 -04:00
|
|
|
grunt.loadNpmTasks( 'grunt-jsonlint' );
|
2017-01-23 10:14:01 -05:00
|
|
|
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: {
|
|
|
|
reportUnusedDisableDirectives: true,
|
|
|
|
cache: true
|
|
|
|
},
|
2017-01-23 10:14:01 -05:00
|
|
|
all: [
|
|
|
|
'*.js',
|
|
|
|
'**/*.js',
|
2017-08-03 09:02:59 -04:00
|
|
|
'!node_modules/**',
|
|
|
|
'!vendor/**'
|
2017-01-23 10:14:01 -05:00
|
|
|
]
|
2015-06-25 14:54:19 -04:00
|
|
|
},
|
|
|
|
jsonlint: {
|
|
|
|
all: [
|
2017-01-23 10:14:01 -05:00
|
|
|
'*.json',
|
2015-06-25 14:54:19 -04:00
|
|
|
'**/*.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: [
|
|
|
|
'*.{le,c}ss',
|
|
|
|
'**/*.{le,c}ss',
|
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' );
|
2017-01-23 10:14:01 -05:00
|
|
|
grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'banana', 'stylelint' ] );
|
2019-02-07 01:25:33 -05:00
|
|
|
grunt.registerTask( 'default', [ 'minify', 'test' ] );
|
2015-06-25 14:54:19 -04:00
|
|
|
};
|