Skip to content

Commit

Permalink
rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Aug 5, 2024
1 parent f22a965 commit c783012
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/ExternalModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -760,10 +760,11 @@ class ExternalModule extends Module {
if (!(/** @type {BuildInfo} */ (this.buildInfo).module)) {
if (!runtimeTemplate.supportsDynamicImport()) {
throw new Error(
"The target environment doesn't support dynamic import() syntax so it's not possible to use external type 'module' within a script" +
(runtimeTemplate.supportsEcmaScriptModuleSyntax()
`The target environment doesn't support dynamic import() syntax so it's not possible to use external type 'module' within a script${
runtimeTemplate.supportsEcmaScriptModuleSyntax()
? "\nDid you mean to build a EcmaScript Module ('output.module: true')?"
: "")
: ""
}`
);
}
return getSourceForImportExternal(
Expand Down
1 change: 1 addition & 0 deletions types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5349,6 +5349,7 @@ type IgnorePluginOptions =
type ImportAttributes = Record<string, string> & {};
declare interface ImportDependencyMeta {
attributes?: ImportAttributes;
externalType?: "import" | "module";
}
declare interface ImportModuleOptions {
/**
Expand Down

0 comments on commit c783012

Please sign in to comment.