You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, the list of external modules must be fully defined before executing the bundler.
But defining this list statically is not trivial in the following scenarios:
imports that "reach into" modules, like import bar from "foo/bar"
external modules that are aliased to some other name via an import map or some other form of custom resolution logic
Workaround
The current workaround is to add a custom "pre-bundle" phase where the complete codebase is crawled, each import is visited analyzed (usually by a variation of the logic that will be later used to implement the "Resolve" trait), and a list of external modules is gathered.
Problem Statement
Currently, the list of external modules must be fully defined before executing the bundler.
But defining this list statically is not trivial in the following scenarios:
import bar from "foo/bar"
Workaround
The current workaround is to add a custom "pre-bundle" phase where the complete codebase is crawled, each import is visited analyzed (usually by a variation of the logic that will be later used to implement the "Resolve" trait), and a list of external modules is gathered.
This list is then fed to the bundler.
Proposed Solution
Other bundlers like Rollup and ESBuild allow "marking" a module as external during the resolution phase. See: https://rollupjs.org/guide/en/#resolveid
The text was updated successfully, but these errors were encountered: