I have a node application with the .babelrc file as follows:
{
"presets": [
["env", { "modules": "commonjs" }],
"stage-2"
],
"plugins": ["transform-runtime"],
"comments": false,
"env": {
"test": {
"presets": ["env", "stage-2"],
"plugins": [ "istanbul" ]
}
}
}
I am still getting the error as follows when I run the project:
(function (exports, require, module, __filename, __dirname) { import Vue from 'vue'
^^^^^^
SyntaxError: Unexpected token import
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:599:28)
at Module._extensions..js (module.js:646:10)
at Object.require.extensions.(anonymous function) [as .js] (/home/sagopale/projects/bfg-trucks/node_modules/babel-register/lib/node.js:152:7)
Where am I going wrong? Is there something additional with babel that I need to do? I have also tried adding babel-preset-es2015
but getting same error.