Created
July 27, 2013 01:39
-
-
Save shirokuro331/6093306 to your computer and use it in GitHub Desktop.
Grunt
This file contains hidden or 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": "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" | |
| } | |
| } |
This file contains hidden or 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({ | |
| 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