We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bffc296 commit fdbb550Copy full SHA for fdbb550
1 file changed
packages/react-dev-utils/InlineChunkHtmlPlugin.js
@@ -17,7 +17,7 @@ class InlineChunkHtmlPlugin {
17
if (tag.tagName !== 'script' || !(tag.attributes && tag.attributes.src)) {
18
return tag;
19
}
20
- const scriptName = tag.attributes.src.replace(publicPath, '');
+ const scriptName = publicPath ? tag.attributes.src.replace(publicPath, '') : tag.attributes.src;
21
if (!this.tests.some(test => scriptName.match(test))) {
22
23
@@ -29,8 +29,8 @@ class InlineChunkHtmlPlugin {
29
30
31
apply(compiler) {
32
- let publicPath = compiler.options.output.publicPath;
33
- if (!publicPath.endsWith('/')) {
+ let publicPath = compiler.options.output.publicPath || '';
+ if (publicPath && !publicPath.endsWith('/')) {
34
publicPath += '/';
35
36
0 commit comments