Skip to content
This repository was archived by the owner on Jul 16, 2021. It is now read-only.

Commit 725c6f2

Browse files
committed
Treat publicPath === ‘’ as meaning auto
We can’t do _nothing_ to publicPath, as the urls we output will not be correct if the css is output into a subfolder. This change means we treat publicPath ‘’ as meaning, my assets are available in the root of the webpack context, and please use relative paths to find them, and that’s what we do.
1 parent 1c4470d commit 725c6f2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/loader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,14 @@ export function pitch(request) {
5656
const childFilename = '*';
5757
const publicPath =
5858
typeof options.publicPath === 'string'
59-
? options.publicPath === 'auto'
59+
? options.publicPath === 'auto' || options.publicPath === ''
6060
? AUTO_PUBLIC_PATH
6161
: options.publicPath === '' || options.publicPath.endsWith('/')
6262
? options.publicPath
6363
: `${options.publicPath}/`
6464
: typeof options.publicPath === 'function'
6565
? options.publicPath(this.resourcePath, this.rootContext)
66-
: this._compilation.outputOptions.publicPath === 'auto'
66+
: this._compilation.outputOptions.publicPath === 'auto' || this._compilation.outputOptions.publicPath === ''
6767
? AUTO_PUBLIC_PATH
6868
: this._compilation.outputOptions.publicPath;
6969

0 commit comments

Comments
 (0)