Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/react-dev-utils/InlineChunkHtmlPlugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class InlineChunkHtmlPlugin {
if (tag.tagName !== 'script' || !(tag.attributes && tag.attributes.src)) {
return tag;
}
const scriptName = tag.attributes.src.replace(publicPath, '');
const scriptName = publicPath ? tag.attributes.src.replace(publicPath, '') : tag.attributes.src;
if (!this.tests.some(test => scriptName.match(test))) {
return tag;
}
Expand All @@ -29,8 +29,8 @@ class InlineChunkHtmlPlugin {
}

apply(compiler) {
let publicPath = compiler.options.output.publicPath;
if (!publicPath.endsWith('/')) {
let publicPath = compiler.options.output.publicPath || '';
if (publicPath && !publicPath.endsWith('/')) {
publicPath += '/';
}

Expand Down