Last active
August 29, 2015 14:19
-
-
Save emersonmx/c2b70848e7a0661acca1 to your computer and use it in GitHub Desktop.
Script para automatizar a criação de javascript e css
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function (grunt) { | |
grunt.initConfig({ | |
pkg: grunt.file.readJSON("package.json"), | |
concat: { | |
dist: { | |
src: [ | |
"js/*.js" | |
], | |
dest: "../static/js/blog.js" | |
} | |
}, | |
uglify: { | |
build: { | |
src: "../static/js/blog.js", | |
dest: "../static/js/blog.min.js" | |
} | |
}, | |
imagemin: { | |
dynamic: { | |
files: [{ | |
expand: true, | |
cwd: "img/", | |
src: ["**/*.{png,jpg,gif}"], | |
dest: "../static/img/" | |
}] | |
} | |
}, | |
sass: { | |
dist: { | |
options: { | |
style: "compressed" | |
}, | |
files: { | |
"../static/css/blog.css": "sass/blog.scss" | |
} | |
} | |
}, | |
watch: { | |
scripts: { | |
files: ["js/*.js"], | |
tasks: ["concat", "uglify"], | |
options: { | |
spawn: false | |
} | |
}, | |
css: { | |
files: ["sass/*.scss"], | |
tasks: ["sass"], | |
options: { | |
spawn: false | |
} | |
} | |
} | |
}); | |
grunt.loadNpmTasks("grunt-contrib-concat"); | |
grunt.loadNpmTasks("grunt-contrib-uglify"); | |
grunt.loadNpmTasks("grunt-contrib-imagemin"); | |
grunt.loadNpmTasks("grunt-contrib-sass"); | |
grunt.loadNpmTasks("grunt-contrib-watch"); | |
grunt.registerTask("default", [ | |
"concat", "uglify", "imagemin", "sass" | |
]); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "assets", | |
"version": "1.0.0", | |
"devDependencies": { | |
"grunt": "^0.4.5", | |
"grunt-cli": "^0.1.13", | |
"grunt-contrib-concat": "^0.5.1", | |
"grunt-contrib-imagemin": "^0.9.4", | |
"grunt-contrib-sass": "^0.9.2", | |
"grunt-contrib-uglify": "^0.9.1", | |
"grunt-contrib-watch": "^0.6.1" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
node_modules/grunt-cli/bin/grunt watch |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment