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

output of output.format = 'system' has 'use strict'; when output.strict = false #3100

Closed
askbeka opened this issue Sep 7, 2019 · 5 comments

Comments

@askbeka
Copy link
Contributor

askbeka commented Sep 7, 2019

  • Rollup Version: 1.20.3
  • Operating System (or Browser): Linux
  • Node Version: 10

Not sure fully if it is a bug. But it does not allow me to use modules that require to run in non strict mode to function properly.

How Do We Reproduce?

Currently it is constant as seen from this line

Expected Behavior

No 'use strict'; added

Actual Behavior

'use strict'; is present

@lukastaegert
Copy link
Member

Rollup is essentially as polyfill of sorts for ES modules, so the assumption is that you are writing code that is valid in an ES module. Thus for all other formats, use strict is added to make sure the behaviour is equivalent.

@lukastaegert
Copy link
Member

Or to put it differently, modules are always implicitly in strict mode by specification. There is however a flag to disable this.

@askbeka askbeka changed the title output of output.format = 'system' has 'use strict'; when output.script = false output of output.format = 'system' has 'use strict'; when output.strict = false Sep 7, 2019
@askbeka
Copy link
Contributor Author

askbeka commented Sep 7, 2019

@lukastaegert thanks. I have used that flag but systemjs output does not respect it.
I can check if I can workaround it.

@lukastaegert
Copy link
Member

Sorry, I kinda missed that point 😉. Yes, strict should also work for SystemJS but apparently was forgotten to be implemented. Marking it as a bug.

@lukastaegert
Copy link
Member

Closed via #3101

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

No branches or pull requests

2 participants