GCoffeeScriptBuilder

Transpile coffeescript files into javascript.

Builder specific Options

Available options for BuildConfig.buildOptions:

OptionTypeDefaultDescription
sourceMapbooleanfalseEnable sourceMap generation
lintbooleanfalseEnable linter
minifybooleanfalseGenerate minified *.min.js in addition to non-minified output
minifyOnlybooleanfalseGenerate minified *.min.js files only with no non-minified output
outFileOnlybooleantrueGenerate concatenated outfile only. This option is valid only when BuildConfig.outFile is set
babelbooleanfalseEnable 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
},
};