ext-javascript
JavaScript transpiler with babel support.
Usage
rtb.javascript(options={});
Options
options will override rtb.moduleOptions.
rtb.buildOptions (BuildConfig.buildOptions)
Option | Type | Default | Description |
---|---|---|---|
babel | boolean | false | Enable babel. |
lint | boolean | false | Enable lint. |
rtb.moduleOptions (BuildConfig.moduleOptions)
Property | Type | Default | Description |
---|---|---|---|
babel | Object | {} | Options to gulp-babel. |
eslint | Object | {} | Options to gulp-eslint. |
Example
const javaScript = {
name: 'javaScript',
builder: (rtb) => rtb.src().javascript().dest(),
src: ['assets/style/**/*.js'],
dest: 'www/css',
outFile: 'sample.js',
buildOptions: {
babel: true,
},
moduleOptions: {
eslint: {
"extends": "eslint:recommended",
"rules": { "strict": 1 },
"parserOptions": { "ecmaVersion": 6, }
}
}
};
Notes
This extension is for custom processing. Use GJavaScriptBuilder for javascript file processiing.