Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Bundler support track #45

Open
33 of 41 tasks
fi3ework opened this issue Jul 26, 2024 · 0 comments
Open
33 of 41 tasks

Bundler support track #45

fi3ework opened this issue Jul 26, 2024 · 0 comments
Assignees

Comments

@fi3ework
Copy link
Member

fi3ework commented Jul 26, 2024

Bundler supports

Tracking the bundler supports for the optimal output (webpack1 and Rspack).

(ESM) Tree shakable export

(ESM) ESM export should be tree-shakable.

(ESM) ESM output won't break by scope isolation when bundling module bailout from concatenation.

(ESM) Remove unnecessary webpack exports runtime

(ESM) Force concatenation single module

(ESM) Externals

Externalized module import / dynamic import will introduce redundant runtime in webpack / Rspack. Dynamic import will be hoisted to the top level (webpack/webpack#17986). Furthermore, the import and import() should be leave unchanged.

(ESM) Avoid using namespace import for external module for better readability P0

(ESM) Dynamic import (Chunk splitting) P1

Static analysis is not possible due to the public path at runtime.

(ESM) Preserve CSS Import

  • CSS import statement will be extracted out.

(ESM) Node.js Shims

(CJS) Support static analyzable export.

(CJS / ESM) preserve require

require and require.resolve

  • ESM:
    • require(...) should be either behave like esbuild (sniff and throw as a fallback) or be shimmed with createRequire.
    • require.resolve(...) should be either behave like esbuild (sniff and throw as a fallback) or be shimmed with createRequire.
  • CJS:

(ESM) Re-export with property access or eval

(ESM) Multiple entries P2

Export in library works only for last entry module

(ESM) Entry module demanding not to be bailed out.

  • Entry module must not trigger concatenation bail out (such as contains eval expression), otherwise it will break the current "modern-module"'s ESM export premise.

non-Rslib related ESM feature support in Rspack

  • HMR

Footnotes

  1. Reference: https://github.com/webpack/webpack/issues/17121

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant