Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InlineChunkHtmlPlugin works with empty publicPath #6735

Merged
merged 2 commits into from
Apr 16, 2019
Merged
Changes from 1 commit
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.length > 0 && !publicPath.endsWith('/')) {
ItalyPaleAle marked this conversation as resolved.
Show resolved Hide resolved
publicPath += '/';
}

Expand Down