GJavaScriptBuilder
JavaScript transpiler.
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. |
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, }
}
},
};