I'm getting Error: Parsing file app.js: 'import' and 'export' may appear only with 'sourceType: module' (1:0)
while using gulp with browserify and babelify
I only get the issue with one specific import vue-masked-input
my gulp task looks like this
gulp.task('js', () => {
let b = browserify({
entries: './resources/assets/js/app.js',
debug: true,
transform: [
babelify.configure({
presets: [["es2015"]]
}),
'vueify'
]
});
return b.bundle().on('error', function (e) {
console.log(e.toString());
this.emit('end');
})
.pipe(source('app.js'))
.pipe(buffer())
.pipe(prod ? uglify() : util.noop())
.pipe(gulp.dest('./public/js'))
;
});
I tried a few suggestions I found around the web including:
presets: [["es2015", {modules: false}]],
sourceType: 'module',
(under babelify.configure)