gulp-babel
gulp-babel copied to clipboard
Literals are not transformed
Trying to use .babelrc config, but as a result use configuration in a task: package.json:
"@babel/core": "7.4.4",
"@babel/plugin-transform-template-literals": "7.4.4",
"gulp-babel": "8.0.0",
gulp-task (show in project):
import gBabel from 'gulp-babel';
import gHtml2Js from 'gulp-html-to-js';
import gReplace from 'gulp-replace';
task('tmpl2js',
() => src([`${absSrc}/**/*.html`])
.pipe(gHtml2Js())
.pipe(gReplace('module.exports =', 'export default'))
// BUG?! Babel is not transformed string/template literals!
.pipe(gBabel({
plugins: [
['@babel/plugin-transform-template-literals'],
],
}))
.pipe(dest(absDest)));