Vueify and Babel 7

249 Views Asked by At

I am using Gulp, Browserify, Vueify and Babel to build my vue.js project. I cannot move to another building system, so Gulp it is. I recently updated from Babel 6 to Babel 7, due to a new addition in my project : Jest and unit testing (Babel 7 is a requirement)

Unfortunately, this had as a side effect Vueify to stop working with Babel 7, because it seems they are not compatible, or something. Npm Vueify package has not been updated for 2 years and I found a git issue that no-one has commented officially.

Has anyone faced and resolved the same issue? Any alternatives to Vueify? Thanks

1

There are 1 best solutions below

0
On

You are right ! Vueify stopped maintaining their repository. Although, I was able to use the following fork : "vueify":"github:stendahls/vueify#master" which adds support for Babel 7 and @babel/preset-env. I will fork it myself but my tests were conclusive.

Then, in my Gulpfile I could use the following :

gulp.task('vueapp', () => {
    return browserify('assets/vueapp/js/main.js')
        .transform(vueify)
        .transform(babelify, {
            presets: ["@babel/preset-env"]
        })
        .bundle()
        .pipe(source('vueapp.js'))
        .pipe(gulp.dest('public/build/vueapp/js/'));
});