-
-
Notifications
You must be signed in to change notification settings - Fork 599
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: support experiments.outputModule
#2803
Conversation
|
Overall, LGTM. But it seems that you only used |
One more question, is this feature used a lot? |
Not sure.. |
packages/rspack/tests/configCases/output-module/simple/webpack.config.js
Outdated
Show resolved
Hide resolved
* feat: output module * fix: format * fix: test * fix: test * fix: test * fix: avoid add tree_shaking_result * fix: test * fix: test * fix: test * fix: test
* feat: output module * fix: format * fix: test * fix: test * fix: test * fix: avoid add tree_shaking_result * fix: test * fix: test * fix: test * fix: test
Related issue (if exists)
close #2612
Summary
ConfigCase.template.js
to configCase test🤖 Generated by Copilot at 5a87e69
This pull request adds support for generating ES modules as output for the rspack bundler. It introduces new plugins, runtime modules, and output types to handle the module format and the dynamic import feature. It also enables tree shaking for the "module" output type and passes the entry module identifier to the plugins for more flexibility. It refactors some existing code and comments out some error checking for the AMD library name.
Walkthrough
🤖 Generated by Copilot at 5a87e69
render_startup
hook of the plugins and use it to generate the startup code for the chunk (link, link, link, link, link, link, link)__webpack_require__
function and handling the chunk loading logic for the "module" and the "import" output types (link, link, link, link, link, link, link, link)ModuleLibraryPlugin
for the "module" output type and use the tree shaking analysis results to generate the export names for the entry module (link, link, link)ModuleChunkFormatPlugin
for the "module" output type and use theRuntimeGlobals::STARTUP_ENTRYPOINT
global variable to store the entry point function for the chunk (link, link, link, link)ModuleChunkLoadingPlugin
for the "import" output type and use theget_runtime_chunk_path
function to get the relative path to the runtime chunk (link, link, link, link, link)CommonJsChunkFormatPlugin
by using theget_runtime_chunk_path
function (link, link)property_access
function from theassign_library_plugin.rs
module to theutils.rs
module and import it from there (link, link)normalize_name
function in theutils.rs
module to temporarily disable the error checking for the AMD library name (link)