比如把coffee文件写在coffee/controller/文件夹下,新建js/controller文件夹,使用grunt运行项目,将自动编译coffee到相应的js文件夹下。

module.exports = function(grunt) {
// 项目配置信息.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
options : {
jshintrc: '.jshintrc',
// eqeqeq: true,
// tradiling: true,
ignores: ['node_modules/**/*.js']
},
all: ['**/*.js']
},
coffee:{
compile: {
options: {
sourceMap: false,
bare: true
},
files: [{
expand: true,
cwd: "coffee/",
src: '**/*.coffee',
dest: 'js/',
ext: '.js'
}]
}
},
watch: {
coffee: {
files: ['**/*.coffee'],
tasks: ['coffee:compile']
// },
// js: {
// files: ['**/*.js'],
// tasks: ['jshint'],
// options: {
// livereload: true
// }
}
},
nodemon: {
dev: {
script: 'bin/www',
options: {
args: [],
ignoredFiles: [],
watchedExtensions: ['js'],
watchedFolders: ['./'],
debug: true,
delayTime: 1,
env: {
PORT: 3000
},
cwd: __dirname
}
}
},
concurrent: {
tasks: ['watch','nodemon'],
options: {
logConcurrentOutput: true
}
}
});
// 加载"uglify"插件..
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-nodemon');
grunt.loadNpmTasks('grunt-concurrent');
//grunt.loadNpmTasks('grunt-ssh'); grunt.option('force', true); // 注册默认任务.
grunt.registerTask('default', ['concurrent']);
};

最新文章

  1. C# ini文件操作【源码下载】
  2. DNS解析全过程及原理
  3. 05章 OGNL
  4. bzoj4165: 矩阵
  5. Linux系统时间设置(转载)
  6. 结构型:代理模式 Vs 适配器模式 Vs 门面模式(外观模式)
  7. Ubunut 13.04下配置memcached、 python MySQLDB,python-memcache模块等
  8. android下4G上网卡
  9. zz[C++]合理的设计和使用消息队列
  10. ORA-01093: ALTER DATABASE CLOSE only permitted with no sessions connected解决方法
  11. javascript 自己主动绑定JS callback 的方法函数
  12. HDU-1233-还是畅通工程(并查集)
  13. JavaScript异步编程:Generator与Async
  14. python入门学习:5.字典
  15. Python 练习: 简单角色游戏程序
  16. vmtools是灰色不可用的
  17. 基于nodejs环境,用npm简单搭建一个本地服务器Live-server的使用
  18. js通过class获取元素
  19. arduino 配置 esp8266
  20. chrome和Firefox对p标签中单词换行的渲染(强制换行)

热门文章

  1. 转让malloc()该功能后,发生了什么事内核?附malloc()和free()实现源
  2. C#-默认显示前列-ShinePans
  3. 北京设计模式学习组bjdp.org第7次活动(2013.08.04)回顾会纪要
  4. atitit.无损传输二进制数据串传输网络
  5. EnumMap demo
  6. [POJ 3311]Hie with the Pie——谈论TSP难题DP解决方法
  7. Android Volley彻底解决(三),定制自己Request
  8. maven_基本配置
  9. 使用ArcGIS API for Silverlight实现地形坡度在线分析
  10. 【百度地图API】如何利用自己的数据制作社交地图?只显示可视区域内的标注