GJavaScriptBuilder

JavaScript transpiler.

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.

Example

const javaScript = {
name: 'javaScript',
builder: 'GJavaScriptBuilder',
src: [upath.join(srcRoot, 'scripts/js/**/*.js')],
// use order property to set outFile orders
order: ['*main.js'],
dest: upath.join(destRoot, 'js'),
outFile: 'sample.js',
buildOptions: {
lint: true,
babel: true,
minify: true,
sourceMap: true
},
moduleOptions: {
eslint: {
"extends": "eslint:recommended",
"rules": { "strict": 1 },
"parserOptions": { "ecmaVersion": 6, }
}
},
};