我想Gruntfile.js
用livescript写我的。
我已经完成了Gruntfile.js
,并且Gruntfile.coffee
两者都可以开箱即用
Gruntfile.ls
应该工作......对吗?
我在网上看过一些Gruntfile.ls
,还是需要编译(.coffee 版本除外)?
现场脚本
(调用时出错$ grunt
)
A valid Gruntfile could not be found. Please see the getting started guide for
more information on how to configure grunt: http://gruntjs.com/getting-started
Fatal error: Unable to find Gruntfile.
咕噜文件.ls
#global module:false
module.exports = (grunt) ->
# Project configuration.
grunt.init-config {}=
meta:
version: \0.0.1
livescript:
src:
files:
"build/js/main.js": "src/scripts/main.ls"
watch:
livescript:
files: <[src/scripts/**/*.ls]>
tasks: <[livescript]>
options: {+livereload}
# load tasks
grunt.loadNpmTasks \grunt-livescript
grunt.loadNpmTasks \grunt-contrib-watch
# register tasks
grunt.registerTask \default, <[livescript]>
编译:
(打电话时有效$ grunt
)
Gruntfile.js
module.exports = function(grunt){
grunt.initConfig({
meta: {
version: '0.0.1'
},
livescript: {
src: {
files: {
"build/js/main.js": "src/scripts/main.ls"
}
}
},
watch: {
livescript: {
files: ['src/scripts/**/*.ls'],
tasks: ['livescript'],
options: {
livereload: true
}
}
}
});
grunt.loadNpmTasks('grunt-livescript');
grunt.loadNpmTasks('grunt-contrib-watch');
return grunt.registerTask('default', ['livescript']);
};