Skip to content

Instantly share code, notes, and snippets.

@jayhjkwon
Last active December 16, 2015 01:08
Show Gist options
  • Save jayhjkwon/5352326 to your computer and use it in GitHub Desktop.
Save jayhjkwon/5352326 to your computer and use it in GitHub Desktop.
Compile coffee-script using Grunt v0.4.1, one-to-one basis
module.exports = function (grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
watch : {
tasks : 'coffee',
files : ['**/*.coffee']
},
coffee: {
compile: {
options:{
bare: true,
sourceMap : true
},
files: [
{
expand: true,
cwd: 'webapp/',
src: ['**/*.coffee'],
dest: 'webapp/',
ext: '.js'
}
]
}
},
qunit: {
all: {
options: {
urls: ['http://localhost:8080/js/tests/test.html']
}
}
},
requirejs: {
compile: {
options: {
baseUrl : './webapp/js',
mainConfigFile: './webapp/js/require-config.js',
out : './webapp/js/app.min.js',
locale : "ko-kr",
name : 'app',
include : ['require-config'],
exclude : ['jquery'],
optimize : 'none'
}
}
},
less: {
production: {
options: {
paths : ['./webapp/less/app'],
yuicompress: 'true'
},
files : {
'./webapp/css/app/app.min.css': './webapp/less/app/style.less'
}
}
}
});
// Load tasks from NPM
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-requirejs');
grunt.loadNpmTasks('grunt-contrib-less');
grunt.loadNpmTasks('grunt-contrib-coffee');
// register task.
grunt.registerTask('default', ['coffee', 'qunit', 'requirejs', 'less']);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment