Skip to content

Bundler support track #45

Open
Open
@fi3ework

Description

@fi3ework

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 shares module graph

Multiple entries share the same module graph which will make bail out reason turn out to be a merge of all the entries and breaks the concatenation.

(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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions