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

Deno.bundle() should accept the compiler flag importsNotUsedAsValues #6663

Closed
timonson opened this issue Jul 6, 2020 · 2 comments · Fixed by #8306
Closed

Deno.bundle() should accept the compiler flag importsNotUsedAsValues #6663

timonson opened this issue Jul 6, 2020 · 2 comments · Fixed by #8306
Assignees
Labels
cli related to cli/ dir feat new feature (which has been agreed to/accepted)

Comments

@timonson
Copy link
Contributor

timonson commented Jul 6, 2020

This tsc compiler flag was implemented in TypeScript 3.8. You can find the merged PR here: microsoft/TypeScript#35200

This flag takes 3 different values:

  • remove: this is today’s behavior of dropping these imports. It’s going to continue to be the default, and is a non-breaking change.
  • preserve: this preserves all imports whose values are never used. This can cause imports/side-effects to be preserved.
  • error: this preserves all imports (the same as the preserve option), but will error when a value import is only used as a type. This might be useful if you want to ensure no values are being accidentally imported, but still make side-effect imports explicit.

It would be very helpful for Web Components and other stuff.

@bartlomieju
Copy link
Member

Ref #6456

CC @kitsonk

@kitsonk
Copy link
Contributor

kitsonk commented Jul 6, 2020

@bartlomieju this is different... It just needs to be added to the compiler APIs Compiler Options and converted to the right internal TypeScript type.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli related to cli/ dir feat new feature (which has been agreed to/accepted)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants