Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Grunt
{
"name": "sample",
"version": "0.0.1",
"description": "grunt sample",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"repository": "",
"author": "shirokuro331",
"license": "BSD",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-compass": "~0.3.0",
"grunt-contrib-watch": "~0.4.4",
"grunt-contrib-connect": "~0.3.0",
"grunt-contrib-cssmin": "~0.6.1",
"grunt-contrib-imagemin": "~0.1.4",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-uglify": "~0.2.2"
}
}
module.exports = function (grunt) {
grunt.initConfig({
watch:{
sassmin:{
files: 'src/scss/*.scss',
tasks: ['compass','cssmin']
},
js:{
files: 'src/js/*.js',
tasks: ['concat']
},
jsmin:{
files: 'js/all.js',
tasks: ['uglify']
}
},
compass: {
dist: {
options: {
sassDir:'src/scss',
cssDir:'src/css'
}
}
},
cssmin:{
min:{
files:{
'src/css/style.min.css':'src/css/style.css'
}
}
},
concat: {
js: {
src: [
'src/js/*.js',
],
dest: 'js/all.js'
}
},
uglify: {
dist: {
src: 'js/all.js',
dest: 'js/all.min.js'
}
},
imagemin : {
dist : {
options: {
optimizationLevel: 3
},
files : [
{
expand : true,
src: 'img/*.{png,jpg,jpeg}'
}
]
}
}
});
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.registerTask('default', ['watch']);
grunt.registerTask('build', ['imagemin']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.