-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot build svelte components in production #98
Comments
I bet you should check on the production settings. Maybe that the version of uglify that you are using probably doesn't support ES6. |
Googling the kind of error messages you got, reinforce my intuition about ES6 + UglifyJS. And if you want to have support for legacy browsers, like IE11, you should also use a tool like Babel or Buble, to convert your ES6 code to ES5. Did you had the time to take a look ? |
Yeah, UglifyJS is abandonware. Use Terser instead — not sure exactly how to set it up with webpack 3, but fairly sure it's possible |
Thanks for the help. I have tried switching to Terser Legacy for Webpack 3 and many other configurations of UglifyJs/UglifyEs/Babel. Nothing has worked for me so far. I think I'll just end up upgrading to Webpack 4 and that will hopefully make things easier. |
@d3chapma This was working for me with svelte v2.x
|
@Kiho : I think you may have forgot Babel (or another ES6=>ES5 transpiler). The pipeline should go this way :
If you don't care of old browsers :
|
As an example, in our webpack3 prowered project, we have the following config ( Please note that the
|
I am using
and setup for terser
This versions work: This doesn't So I'm not sure if it's |
I am trying to use svelte for building components and a legacy Backbone application.
The application is currently built using webpack. I added:
to my
webpack.config
and everything seems to work fine in development, but when I build for production I get the following error:Any thoughts on what might cause something like this?
Update: I am using webpack 3.8.1
The text was updated successfully, but these errors were encountered: