Last active
December 16, 2015 01:08
-
-
Save jayhjkwon/5352326 to your computer and use it in GitHub Desktop.
Compile coffee-script using Grunt v0.4.1, one-to-one basis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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