Skip to content

Commit

Permalink
throw error in fallback case to inform users.
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson authored and binjie chen committed Aug 18, 2020
1 parent c4380f9 commit 057573b
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions lib/runtime/PublicPathRuntimeModule.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,7 @@ class PublicPathRuntimeModule extends RuntimeModule {
} else if ("_getCurrentScript" in document) {
return document._getCurrentScript().src.replace(/[^\\/]+$/, "");
} else {
return ${JSON.stringify(
this.compilation.getPath(
this.compilation.outputOptions.publicPath || "",
{
hash: this.compilation.hash || "XXXX"
}
)
)};
throw new Error("Webpack: Auto public path is not supported in modules or when 'document.currentScript' is unavailable. Set 'publicPath' config explicitly.");
}
})();`;
} else {
Expand Down

0 comments on commit 057573b

Please sign in to comment.