Skip to content

Commit

Permalink
fix: check for http in baseUrl (#1594)
Browse files Browse the repository at this point in the history
  • Loading branch information
IamDLY authored Nov 14, 2020
1 parent 03f0c15 commit ebb5943
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/plugin-webpack/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ function emitHTMLFiles({doms, jsEntries, stats, baseUrl, buildDirectory, htmlMin
for (const cssFile of cssFiles) {
const linkEl = dom.window.document.createElement('link');
linkEl.setAttribute('rel', 'stylesheet');
linkEl.href = path.posix.join(baseUrl, cssFile);
linkEl.href = url.parse(baseUrl).protocol
? url.resolve(baseUrl, cssFile)
: path.posix.join(baseUrl, cssFile);
head.append(linkEl);
}
originalScriptEl.remove();
Expand Down

1 comment on commit ebb5943

@vercel
Copy link

@vercel vercel bot commented on ebb5943 Nov 14, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.