Skip to content
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

Remove the of statements #15

Closed
roccomuso opened this issue Jan 23, 2018 · 8 comments
Closed

Remove the of statements #15

roccomuso opened this issue Jan 23, 2018 · 8 comments

Comments

@roccomuso
Copy link

We might consider the idea to switch from a for (w of st.keys()) statement to a more common one Object.keys(st.keys())... right now webpack's uglify doesn't support the of keyword.

If we change this loop syntax with an older one, anyone can build and use the module also on the browser.

@davedoesdev
Copy link
Owner

davedoesdev commented Jan 24, 2018

In 2018 I'd like to write ES6 :)

https://github.com/webpack-contrib/uglifyjs-webpack-plugin says:

This plugin uses UglifyJS v3 (uglify-es) to minify your JavaScript

webpack =< v3.0.0 currently contains v0.4.6 of this plugin under webpack.optimize.UglifyJsPlugin as an alias. For usage of the latest version (v1.0.0), please follow the instructions below. Aliasing v1.0.0 as webpack.optimize.UglifyJsPlugin is scheduled for webpack v4.0.0

It looks like you can work around it in webpack.config.js, until webpack 4.0.0 arrives.

@roccomuso
Copy link
Author

Sadly with the current create-react-app module you can't touch the webpack.config.js

@davedoesdev
Copy link
Owner

I think maybe the webpack.config.js is fine: https://github.com/facebook/create-react-app/blob/25184c4e91ebabd16fe1cde3d8630830e4a36a01/packages/react-scripts/config/webpack.config.prod.js#L385

But I can't see where it depends on uglifyjs-webpack-plugin.

@davedoesdev
Copy link
Owner

@davedoesdev
Copy link
Owner

Looks like the fix came in here 15 days ago: facebook/create-react-app@ff54494

@davedoesdev
Copy link
Owner

@davedoesdev
Copy link
Owner

@roccomuso did the latest create-react-app work?

@roccomuso
Copy link
Author

@davedoesdev yes, thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants