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

Support emitting ES6 modules #723

Closed
wants to merge 8 commits into from
Closed

Support emitting ES6 modules #723

wants to merge 8 commits into from

Conversation

theseanl
Copy link
Owner

@theseanl theseanl commented Aug 16, 2022

  • Clean up code
  • Fix test so that it passes on Windows
  • Add documentation in packages/rollup-plugin-tscc/README.md
  • Add documentation on spec.chunkFormat in README.md
  • Throw an error when "chunkFormat": "module" is used in conjunction with "external", until External module support for ES6 module output #724 is implemented.

adds a new feature that allows users to perform build that
generates es6 modules as output chunks. Previously, output chunks need
to be executed in a shared global scope in order for later chunks to
reference variables in previous chunks. By adding `chunkFormat` key to
the spec file, the closure compiler build will be done using
chunk_output_type = ES_MODULES, and rollup build will be done using a
usual code-splitting build with tight control of each chunk's location
in the final bundle.

Currently it does not work with the spec file's `external` option. It
"sort of" works for rollup, but again it still doesn't work with
external modules specified with relative paths. On the closure compiler
side, it is even less clear what should be done, but it seems clear that
this is the way to go.

because Closure Stylesheets is discontinued, it is unlikely that we will
ever implement these in spec file. Maybe accept key-value pairs of css
renaming maps manually?
This commit adds a new feature that allows users to perform build that
generates es6 modules as output chunks. Previously, output chunks need
to be executed in a shared global scope in order for later chunks to
reference variables in previous chunks. By adding `chunkFormat` key to
the spec file, the closure compiler build will be done using
chunk_output_type = ES_MODULES, and rollup build will be done using a
usual code-splitting build with tight control of each chunk's location
in the final bundle.

Currently it does not work with the spec file's `external` option. It
"sort of" works for rollup, but again it still doesn't work with
external modules specified with relative paths. On the closure compiler
side, it is even less clear what should be done, but it seems clear that
this is the way to go.
@theseanl theseanl changed the title Rollup manual chunks Support emitting ES6 modules Aug 16, 2022
@theseanl theseanl force-pushed the rollup-manual-chunks branch from 8f9b160 to ee7a75a Compare August 16, 2022 18:25
@theseanl
Copy link
Owner Author

Merged at 1088d6e

@theseanl theseanl closed this Aug 16, 2022
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.

1 participant