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

dynamicPublicPath option should consider using url.resolve for concatenation with publicPath #366

Open
elios264 opened this issue Jul 9, 2019 · 0 comments

Comments

@elios264
Copy link

elios264 commented Jul 9, 2019

  • Operating System: Windows
  • Node Version: 12.x
  • NPM Version: 6.9.0
  • webpack Version: 4.35.2
  • ${package} Version: 2.25.0

publicPath usually ends with a slash as in webpack docs:

The value of the option is prefixed to every URL created by the runtime or loaders. Because of this the value of this option ends with / in most cases.

so with this simple concatenation:

  if (overrides.dynamicPublicPath) {
    options.path = __webpack_public_path__ + options.path;
  }

we usually end up with double slash.

Expected Behavior

having only one slash web making request to middleware hmr

Actual Behavior

I'm having 2 slashes so hmr is broken

How Do We Reproduce?

setup up in webpack config:
'webpack-hot-middleware/client?dynamicPublicPath=true'
as entry point
set up
output: { publicPath: ${process.env.APP_URL}/, ... }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant