vue-snotify
vue-snotify copied to clipboard
Unexpected token: name (code)
I'm unable to compile my project with webpack because an error is thrown by UglifyJS : Unexpected token: name (code). Its because my project does not use babel or ES6 syntax, but there is ES6 syntax in the compiled version of this module (version 3.2.0).
Solution
I fixed it by doing :
import Snotify from 'vue-snotify/vue-snotify.min.js'
instead of
import Snotify from 'vue-snotify'
which loads the minimified version instead of the commonjs module, it works fine.
I'm creating this issue because
1. I looked into other vue-* modules (ex: vue-router) and there is no ES6 syntax in their final /dist files. It could be a good idea to transpile the code of this module too !
2. I also noticed that every files of this project get installed by npm :

There is probably stuff we don't need in there ? I think you can choose files installed using the files property in the package.json like so :
https://github.com/vuejs/vue-router/blob/e2a19cc9177a476051143f97ac21f231ff263406/package.json#L16-L19
Feel free to do something (or nothing) about it ! :smile:
I'm having the same issue. Thanks for the work-around!
You just saved my life. Thank you!
Saved my life!
You saved our life too, thanks. Freedomotic team