-
Notifications
You must be signed in to change notification settings - Fork 26
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
SyntaxError: In strict mode code, functions can only be declared at top level or immediately within another function. #25
Comments
@whtsky Show your webpack config |
@whtsky Do you get this with default uglify? |
webpack 4 ships with uglify-es(which is out of maintaince) but we want to use uglify-js so I didn't try actually. But I assume using webpack 3 + uglifyjs would error too. |
@whtsky Well, if you don't have any problems with uglify-es just keep using webpack default. They will swap to terser (uglify-es fork) soon. Unsupported package won't introduce any breaking changes. |
By the way webpack4 in production mode works as expected. |
uglify-es can't handle inline function correctly: mishoo/UglifyJS#2842. And the thing is, I don't think Lines 21 to 22 in 0572ddd
Is valid in ES5 strict mode. |
I can reproduce the issue with Firefox 45.0.0. |
looks like fbjs package transpile their code before publishing to npm
|
The text was updated successfully, but these errors were encountered: