Closed ZebraFlesh closed 3 years ago
Yes, correct, because by default loader uses built-in __webpack_public_path__
variable and it is output.publicPath
@evilebottnawi, Is it a design goal to does not have output.publicPath
as fallback?
Other loaders such as css-loader
works this way.
Documentation Is:
Please Explain in Detail...
The source code in the CDN example of the readme is:
This implies that the
output.publicPath
option is picked up by file-loader when it lacks its ownpublicPath
. So far I haven't been able to get this to work, but when I expand the file-loader options to:everything works as expected.
Your Proposal for Changes
Not sure if this is a code bug or a documentation bug. Looking at the code, I don't see how the the
publicPath
option can be omitted from the file-loader options and have the expected outcome (unless there's some nuance toloaderUtils.getOptions(this)
which would obtain the webpack output options that I don't understand). So this seems like a documentation issue andpublicPath
needs to be repeated in the file-loader options: