Created
May 24, 2014 07:38
-
-
Save grapswiz/9bb37598e69625e42166 to your computer and use it in GitHub Desktop.
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({<% if (altjs == 'coffeescript') { %> | |
coffee: { | |
options: { | |
separator: ';', | |
bare: false, | |
join: true, | |
sourceMap: false | |
}, | |
main: { | |
src: ['<%= opt.coffeeMain %>/**/*.coffee'], | |
dest: '<%= opt.outBase %>/scripts/app.js' | |
}, | |
test: { | |
src: [ | |
'<%= opt.coffeeMain %>/**/*.coffee', | |
'<%= opt.coffeeTest %>/**/*.coffee' | |
], | |
dest: '<%= opt.coffeeTest %>/app_spec.js' | |
} | |
}<% } %><% if (altjs == 'typescript') { %> | |
ts: { | |
options: { | |
compile: true, // perform compilation. [true (default) | false] | |
comments: false, // same as !removeComments. [true | false (default)] | |
target: 'es5', // target javascript language. [es3 (default) | es5] | |
module: 'commonjs', // target javascript module style. [amd (default) | commonjs] | |
noImplicitAny: false, | |
sourceMap: false, // generate a source map for every output js file. [true (default) | false] | |
sourceRoot: '', // where to locate TypeScript files. [(default) '' == source ts location] | |
mapRoot: '', // where to locate .map.js files. [(default) '' == generated js location.] | |
declaration: false // generate a declaration .d.ts file for every output js file. [true | false (default)] | |
}, | |
main: { | |
src: ['<%= opt.tsMain %>/**/*.ts'], | |
out: '<%= opt.outBase %>/scripts/app.js' | |
}, | |
test: { | |
src: [ | |
'<%= opt.tsMain %>/**/*.ts', | |
'<%= opt.tsTest %>/**/*.ts' | |
], | |
dest: '<%= opt.tsTest %>/app_spec.js' | |
} | |
}, | |
tslint: { | |
options: { | |
configuration: grunt.file.readJSON('.tslintrc') | |
}, | |
main: { | |
files: { | |
src: ['<%= opt.tsMain %>/**/*.ts'] | |
} | |
}, | |
test: { | |
files: { | |
src: ['<%= opt.tsTest %>/**/*.ts'] | |
} | |
} | |
}, | |
clean: { | |
clientScript: { | |
src: ['<%= opt.jsMainOut %>/*.js'] | |
}, | |
clientTestScript: { | |
src: ['<%= opt.jsTestOut %>/*.js'] | |
} | |
}<% } %> | |
}); | |
<% if (altjs == 'coffeescript') { %>grunt.registerTask('default', ['coffee:main']);<% } %><% if (altjs == 'typescript') { %> | |
grunt.registerTask('compile', ['clean:clientScript', 'ts:main']); | |
grunt.registerTask('default', ['tslint:main', 'compile']);<% } %> | |
require('load-grunt-tasks')(grunt); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment