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.