GCoffeeScriptBuilder
Transpile coffeescript files into javascript.
Builder specific Options
Available options for BuildConfig.buildOptions:
Option | Type | Default | Description |
---|---|---|---|
sourceMap | boolean | false | Enable sourceMap generation |
lint | boolean | false | Enable linter |
minify | boolean | false | Generate minified *.min.js in addition to non-minified output |
minifyOnly | boolean | false | Generate minified *.min.js files only with no non-minified output |
outFileOnly | boolean | true | Generate concatenated outfile only. This option is valid only when BuildConfig.outFile is set |
babel | boolean | false | Enable babel. |
Notes:
- If babel is enabled, and there's no 'bare' option in moduleOptions.coffee, then {bare: true} is added to the moduleOptions.coffee. To turn this off, set moduleOptions.coffee.babel to false
Example
const upath = require('upath');
const srcRoot = 'assets';
const destRoot = '_build';
const coffeeScript = {
name: 'coffeeScript',
builder: 'GCoffeeScriptBuilder',
src: [upath.join(srcRoot, 'scripts/coffee/**/*.coffee')],
dest: upath.join(destRoot, 'js'),
outFile: 'sample.js',
buildOptions: {
babel: true, // transpile with babel
lint: true,
minifyOnly:true,
sourceMap: true
},
};