-
Notifications
You must be signed in to change notification settings - Fork 42
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
About resolvePublicPath #139
Labels
Comments
Would you mind sending a PR to fix that? 🙂 Code: add-asset-html-webpack-plugin/src/utils.js Lines 12 to 21 in 6f74d9c
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hi ,
is there some problem when call function util.resolvePublicPath with publicPath is undefined,
it doesn't return the relative path from the html template;
`function resolvePublicPath(compilation, filename) {
/* istanbul ignore else */
const publicPath =
typeof compilation.options.output.publicPath !== 'undefined'
? compilation.options.output.publicPath
: _path().default.relative(_path().default.dirname(filename), '.'); // TODO: How to test this? I haven't written this logic, unsure what it does
return ensureTrailingSlash(publicPath);
}`
change to
`function resolvePublicPath(compilation, filename, childCompilationOutputName) {
//Copied from html-webpack-plugin
var publicPath =
typeof compilation.options.output.publicPath !== 'undefined'
? compilation.options.output.publicPath
: _path().default.relative(_path().default.resolve(compilation.options.output.path, _path().default.dirname(childCompilationOutputName)), compilation.options.output.path)
.split(_path().default.sep).join('/');
return ensureTrailingSlash(publicPath);
}
`
will compile the correct relative path
childCompilationOutputName = htmlPluginData.outputName
The text was updated successfully, but these errors were encountered: