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

--module option? #2964

Open
guybedford opened this issue Feb 26, 2018 · 2 comments
Open

--module option? #2964

guybedford opened this issue Feb 26, 2018 · 2 comments
Labels

Comments

@guybedford
Copy link

Perhaps it would make sense to properly distinguish between --module and --script modes?

When using --module uglify-es could:

  • Assume "use strict" by default
  • Do --toplevel mangling by default as we know local variables are not globals

Ideally import/export when not using --module should throw to ensure a correct source goal interpretation, but I understand if this strictness is not desired.

@Rich-Harris
Copy link

Perhaps --module could be implicit if an import/export declaration is encountered, rather than throwing an error?

@avdg
Copy link
Contributor

avdg commented Mar 9, 2018

I believe modules and class code are always strict mode anyway (unless there is something changed with the standard, I think generator functions are non-strict by default but I'm not sure at all)

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

No branches or pull requests

4 participants