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

feat(cli): add support for bundle --no-check #8023

Merged
merged 5 commits into from
Oct 20, 2020

Conversation

kitsonk
Copy link
Contributor

@kitsonk kitsonk commented Oct 19, 2020

Add support for deno bundle --no-check. This uses swc for the bundling (thanks to a lot of hard work and fixes by @kdy1). There are some substantial differences from deno bundle though:

  • The output is a single file ESM file that is a "flattened" version of the input sources. deno bundle uses the System module format and provides a custom loader. While there might be still some defects, we have tried to do some extensive testing to ensure that that the unbundle code behaviour is preserved when bundled.
  • Dynamic imports are left "untouched". This is a significant change from the current behaviour, where sometimes dynamic imports are included in the bundle if they can be statically determined at bundle time. It is a double edged sword bundling dynamic imports, as the behaviour might or might not be desired, so it is best to just leave them alone.
  • import.meta.url and import.meta.main work in the bundle, where import.meta.url will get "hardcoded" at bundle time and import.meta.main will be false for any dependent modules, but be preserved in the bundle for the main/entry point module.

We are looking at replacing deno bundle with this bundling in a subsequent PR.

Fixes #6686

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some quick thoughts, I'll give more detailed review in the morning

cli/ast.rs Outdated Show resolved Hide resolved
cli/tsc_config.rs Outdated Show resolved Hide resolved
Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

cli/ast.rs Show resolved Hide resolved
cli/ast.rs Outdated Show resolved Hide resolved
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

Successfully merging this pull request may close these issues.

Incremental and no check builds for deno bundle
2 participants