radical-dreamers / animated-vue

A plugin to use animate.css animations as Vue2 transitions
MIT License
220 stars 19 forks source link

"Unexpected token import" is thrown out when build #11

Open beiyang99 opened 6 years ago

beiyang99 commented 6 years ago

here is the key code that bringing the error: import GenericTransition from 'animated-vue/src/common/generic-transition';

i made some search, perhaps this error has relationship with babel, my environment cannot recognize export default class GenericTransition in generic-transition.js

however it's okey not to use GenericTransition.

i don't know how to handle this, please do me some help, thank you !

here is my package.json: "babel-core": "^6.26.0", "babel-eslint": "^7.0.0", "babel-loader": "^6.4.1", "babel-plugin-add-module-exports": "^0.2.1", "babel-plugin-transform-runtime": "^6.23.0", "babel-preset-es2015": "^6.24.1", "babel-preset-stage-2": "^6.24.1", "babel-register": "^6.26.0", "babel-polyfill": "^6.26.0",

dragonautdev commented 6 years ago

@beiyang99

Thanks a lot for reporting this. This error is most of the time related to the build process you are using.

Might be a good idea to check the order of packages in your package.json's "devDependencies" entry and make certain things are applied in-order. For instance, I suggest you to switch babel-loader to appear AFTER babel-register.

Also, if you are using webpack, as a last measure you might want to do the following in your webpack config file:

{ test: /\.js$/, loader: 'babel-loader', include: [resolve('src'), resolve('test'), resolve('node_modules/animated-vue')] }

Please let me know if this solved your issue.