自动编译CoffeeScript的Gruntfile.js
2024-10-19 12:33:38
比如把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']);
};
最新文章
- C# ini文件操作【源码下载】
- DNS解析全过程及原理
- 05章 OGNL
- bzoj4165: 矩阵
- Linux系统时间设置(转载)
- 结构型:代理模式 Vs 适配器模式 Vs 门面模式(外观模式)
- Ubunut 13.04下配置memcached、 python MySQLDB,python-memcache模块等
- android下4G上网卡
- zz[C++]合理的设计和使用消息队列
- ORA-01093: ALTER DATABASE CLOSE only permitted with no sessions connected解决方法
- javascript 自己主动绑定JS callback 的方法函数
- HDU-1233-还是畅通工程(并查集)
- JavaScript异步编程:Generator与Async
- python入门学习:5.字典
- Python 练习: 简单角色游戏程序
- vmtools是灰色不可用的
- 基于nodejs环境,用npm简单搭建一个本地服务器Live-server的使用
- js通过class获取元素
- arduino 配置 esp8266
- chrome和Firefox对p标签中单词换行的渲染(强制换行)
热门文章
- 转让malloc()该功能后,发生了什么事内核?附malloc()和free()实现源
- C#-默认显示前列-ShinePans
- 北京设计模式学习组bjdp.org第7次活动(2013.08.04)回顾会纪要
- atitit.无损传输二进制数据串传输网络
- EnumMap demo
- [POJ 3311]Hie with the Pie——谈论TSP难题DP解决方法
- Android Volley彻底解决(三),定制自己Request
- maven_基本配置
- 使用ArcGIS API for Silverlight实现地形坡度在线分析
- 【百度地图API】如何利用自己的数据制作社交地图?只显示可视区域内的标注