1

I'm building a website using vuejs and trying to load agile-vue to use globally in the vue app. So I added following code into main.js:

var VueAgile = require('vue-agile');
Vue.use(VueAgile);

Later on I use browserify with babelify and envify to create a bundle.js file. and use the following code to compile:

NODE_ENV=production browserify -g envify -e main.js > bundle.js

with the babelify preset 'babel-preset-env' setup in the package.json file. I got the following error:

import VueAgile from './Agile.vue'
^ 
ParseError: 'import' and 'export' may appear only with 'sourceType: module'

I got rid of the error with adding esmify:

 NODE_ENV=production browserify -g envify -p esmify  -e main.js > bundle.js

but I got stuck with a new error:

<template>
^
ParseError: Unexpected token

I've been searching a while for a solution and I think there is something wrong with browserify not transforming all files (only topfiles, not dependencies) but I have not found how to force it. All help is appreciated.

  • Did building work before adding `vue-agile`? i.e. if you don't use vue-agile at all, can you build a basic vue "app"? – Jaromanda X Sep 20 '20 at 00:12
  • yes, building worked and website worked, I'm using `vueistope`, `vueimagesloaded`, `vue-scrollto` and `vue-carousel`. Its the latter I wanted to replace because of more features. – Stijn Van der Linden Sep 20 '20 at 10:06

0 Answers0