Gruntfile.coffee配置文件
module.exports = (grunt) ->
grunt.initConfig
pkg: grunt.file.readJSON 'package.json'
coffeelint:
app: [
'coffee/**/*.coffee'
'coffee/*.coffee'
]
coffee:
dist:
options:
sourceMap: false
bare: true
files: [
expand: true
cwd: 'coffee'
src: [
'**/*.coffee'
'*.coffee'
]
dest: 'build/js'
ext: '.js'
]
uglify:
options:
mangle: false
build:
files: [
expand: true
cwd: 'build'
src: [
'**/*.js'
'*.js'
]
dest: 'asset'
ext: '.min.js'
]
sass:
dist:
files: [
expand: true
cwd: 'scss'
src: [
'**/*.scss'
'*.scss'
]
dest: 'build/css'
ext: '.css'
]
cssmin:
build:
files: [
expand: true
cwd: 'build'
src: [
'**/*.css'
'*.js'
]
dest: 'asset'
ext: '.min.css'
]
clean: dist: 'build'
watch:
files: [
'coffee/**/*.*'
'coffee/*.*'
'scss/**/*.*'
'scss/*.*'
]
tasks: ['coffee', 'uglify', 'sass', 'cssmin', 'clean']
options: spawn: false
grunt.loadNpmTasks 'grunt-coffeelint'
grunt.loadNpmTasks 'grunt-contrib-coffee'
grunt.loadNpmTasks 'grunt-contrib-uglify'
grunt.loadNpmTasks 'grunt-contrib-sass'
grunt.loadNpmTasks 'grunt-contrib-cssmin'
grunt.loadNpmTasks 'grunt-contrib-watch'
grunt.loadNpmTasks 'grunt-contrib-clean'
grunt.registerTask 'default', [
'coffeelint'
'coffee:dist'
'sass:dist'
'uglify'
'cssmin'
'clean:dist'
'watch'
]
return