ext-javascript

JavaScript transpiler with babel support.

Usage

rtb.javascript(options={});

Options

options will override rtb.moduleOptions.

rtb.buildOptions (BuildConfig.buildOptions)

OptionTypeDefaultDescription
babelbooleanfalseEnable babel.
lintbooleanfalseEnable lint.

rtb.moduleOptions (BuildConfig.moduleOptions)

PropertyTypeDefaultDescription
babelObject{}Options to gulp-babel.
eslintObject{}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.