summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'MLEB/UniversalLanguageSelector/Gruntfile.js')
-rw-r--r--MLEB/UniversalLanguageSelector/Gruntfile.js72
1 files changed, 59 insertions, 13 deletions
diff --git a/MLEB/UniversalLanguageSelector/Gruntfile.js b/MLEB/UniversalLanguageSelector/Gruntfile.js
index 34bc8f1d..4d11aeb9 100644
--- a/MLEB/UniversalLanguageSelector/Gruntfile.js
+++ b/MLEB/UniversalLanguageSelector/Gruntfile.js
@@ -1,30 +1,76 @@
-/*jshint node:true */
+/* eslint-env node, es6 */
module.exports = function ( grunt ) {
- 'use strict';
- grunt.loadNpmTasks( 'grunt-contrib-jshint' );
+ 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( {
- jshint: {
+ eslint: {
+ all: '.'
+ },
+ stylelint: {
options: {
- jshintrc: true
+ syntax: 'less'
},
- all: [
- '*.js'
+ src: [
+ '**/*.css',
+ '**/*.less',
+ '!lib/**',
+ '!node_modules/**',
+ '!vendor/**'
]
},
- banana: {
- all: 'i18n/'
- },
jsonlint: {
all: [
'**/*.json',
- '!node_modules/**'
+ '!node_modules/**',
+ '!vendor/**'
]
+ },
+ banana: conf.MessagesDirs,
+ // SVG Optimization
+ svgmin: {
+ options: {
+ js2svg: {
+ indent: ' ',
+ 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( 'test', [ 'jshint', 'jsonlint', 'banana' ] );
- grunt.registerTask( 'default', 'test' );
+ grunt.registerTask( 'minify', 'svgmin' );
+ grunt.registerTask( 'test', [ 'eslint', 'stylelint', 'jsonlint', 'banana' ] );
+ grunt.registerTask( 'default', [ 'minify', 'test' ] );
};