Answer the question
In order to leave comments, you need to log in
How to use Gulp 4 + Babel + Vue?
I want to use modern JS on the frontend (also use Vue with its .vue
components).
I want to organize all this pandemonium on Gulp 4.
Here is my task (I took it from the search):
const { src, dest, watch, series, parallel } = require('gulp');
const babel = require('gulp-babel');
function js() {
return src([
'src/js/app.js'
])
.pipe(babel({
presets: ["@babel/preset-env"]
}))
.pipe(dest('build/js/'))
}
exports.js = js
import
ReferenceError: exports is not defined
SyntaxError: Cannot use import statement outside a module
Uncaught ReferenceError: require is not defined
Answer the question
In order to leave comments, you need to log in
You need something that compiles
vue components
to
js @danielabro/vue-js-bundled-by-g...
But as for me, it's all some kind of perversion, in 2020 to use gulp? I have nothing against gulp, I myself have been sitting on it for a long time. But it's almost impossible to develop a modern front-end without webpack/rollup/parcel. Use vue-cli or naked webpack for finer tuning if needed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question