Closed midascodebreaker closed 7 years ago
export error is being caused by the babel runtime and transform-runtime plugin....
i guest i have no choice... to make compiling faster it tooks 60 secs....
without the node_modules. all the files im dependent in node_modules is neglected....
it fast but import error is raise
I encountered the same problem before. what I do to fix it:
vendor
directory, and movethe ES6 libraries such as vuestrap from node_modules
to this directory.webpack.config.js
:
resolve
section:
resolve: { root: path.resolve('./'), modulesDirectories: ['vendor', 'node_modules'] },
node_modules
from babel loader: { test: /\.js$/, loader: 'babel', exclude: /node_modules/ },
that solved my problem, hope it can help you.
Close it due to no feedback. Open a new one if this does not help.
I recently add babel-plugin-transform-runtime ,babel-runtime ,and babel-preset-stage-0 in webpack.config.js and also .babelrc plus i add a exclude folder node_modules in webpack,config.js
babelrc
webpack.config.js
Also to make it compile faster i add this to webpack.config.js
here is my reference...
I can receive 2 errors at different point...
first if i remove the exclude folder of node_modules and i retain other...
i got this ...
But if i remove everything except es2015 in babelrc and the exclude folder in webpack.config.js
i receive an error at this line pertaining to the vuestrap/core in my app.js
yntaxError: import declarations may only appear at top level of a module
this is the line that is throwing the error in my browser and i can only see blank page
To fix this i need to remove all changes in my webpack.config.js and revert back to using es2015 only in babelrc...
Is there a way i can fix this ?
other than this