Skip to content
Extraits de code Groupes Projets
Valider 9c71faa4 rédigé par Thomas Steur's avatar Thomas Steur
Parcourir les fichiers

refs #5165 this is not directly related but can prevent forgetting to minify...

refs #5165 this is not directly related but can prevent forgetting to minify piwik.js. Whenever js/piwik.js is updated grunt will automatically minify/compile it instantly
parent 15fa68ad
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -11,6 +11,23 @@ module.exports = function(grunt) { ...@@ -11,6 +11,23 @@ module.exports = function(grunt) {
spawn: false, spawn: false,
}, },
}, },
piwikjs: {
files: ['js/piwik.js'],
tasks: ["shell:compilePiwikJs"],
options: {
spawn: false,
},
}
},
"shell": {
compilePiwikJs: {
command: "sed '/<DEBUG>/,/<\\/DEBUG>/d' < piwik.js | sed 's/eval/replacedEvilString/' | java -jar yuicompressor-2.4.2/build/yuicompressor-2.4.2.jar --type js --line-break 1000 | sed 's/replacedEvilString/eval/' | sed 's/^[/][*]/\\/*!/' > piwik-min.js && cp piwik-min.js ../piwik.js",
options: {
execOptions: {
cwd: 'js'
}
}
}
}, },
"clean-pattern": { "clean-pattern": {
files: {path: "tmp/assets", pattern: /(.*).css/} files: {path: "tmp/assets", pattern: /(.*).css/}
...@@ -19,6 +36,7 @@ module.exports = function(grunt) { ...@@ -19,6 +36,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('clean-pattern'); grunt.loadNpmTasks('clean-pattern');
grunt.loadNpmTasks('grunt-contrib-watch'); grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-shell');
grunt.file.setBase('../../') grunt.file.setBase('../../')
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
"clean-pattern": "^0.1.2", "clean-pattern": "^0.1.2",
"grunt": ">= 0.4.2", "grunt": ">= 0.4.2",
"grunt-contrib-watch": "^0.6.1", "grunt-contrib-watch": "^0.6.1",
"grunt-shell": "^0.7.0",
"karma": ">= 0.12.1", "karma": ">= 0.12.1",
"karma-chrome-launcher": ">= 0.1.2", "karma-chrome-launcher": ">= 0.1.2",
"karma-firefox-launcher": ">= 0.1.3", "karma-firefox-launcher": ">= 0.1.3",
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter