X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=Gruntfile.js;h=fdbf0efbc5106fe0d423b8caf2e45841fe97bca7;hb=a1e51bf94325130fa3d54d65c071d3ab57a4ab79;hp=707a1fb095b2bd12d6f8e8f194a4d57bbc004ee0;hpb=a7ad3f7358ed6f3525d4f313970ccc8af95123f6;p=lhc%2Fweb%2Fwiklou.git diff --git a/Gruntfile.js b/Gruntfile.js index 707a1fb095..fdbf0efbc5 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -13,6 +13,7 @@ module.exports = function ( grunt ) { grunt.loadNpmTasks( 'grunt-jsonlint' ); grunt.loadNpmTasks( 'grunt-karma' ); grunt.loadNpmTasks( 'grunt-stylelint' ); + grunt.loadNpmTasks( 'grunt-svgmin' ); karmaProxy[ wgScriptPath ] = { target: wgServer + wgScriptPath, @@ -50,12 +51,48 @@ module.exports = function ( grunt ) { disallowBlankTranslations: false }, core: 'languages/i18n/', + exif: 'languages/i18n/exif/', api: 'includes/api/i18n/', installer: 'includes/installer/i18n/' }, stylelint: { src: '{resources/src,mw-config}/**/*.{css,less}' }, + 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', + src: [ + '**/*.svg' + ], + dest: 'resources/src/', + ext: '.svg' + } ] + } + }, watch: { files: [ '.{stylelintrc,eslintrc.json}', @@ -119,9 +156,10 @@ module.exports = function ( grunt ) { return !!( process.env.MW_SERVER && process.env.MW_SCRIPT_PATH ); } ); + grunt.registerTask( 'minify', 'svgmin' ); grunt.registerTask( 'lint', [ 'eslint', 'banana', 'stylelint' ] ); grunt.registerTask( 'qunit', [ 'assert-mw-env', 'karma:main' ] ); grunt.registerTask( 'test', [ 'lint' ] ); - grunt.registerTask( 'default', 'test' ); + grunt.registerTask( 'default', [ 'minify', 'test' ] ); };