gulp-babel icon indicating copy to clipboard operation
gulp-babel copied to clipboard

Literals are not transformed

Open viT-1 opened this issue 6 years ago • 0 comments

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)));

viT-1 avatar Oct 24 '19 10:10 viT-1