-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
deep linking with contentBase gives a problematic side effect. #640
Comments
I think the problem is that when using Previously this was not the case, I think it was changed in beta 8. Could you check if beta 7 works for you? |
Doesn't work with beta 7 and according to #642 happens from beta 6 |
This is actually a very problematic issue. Every change here seems to break someone's setup, but we're getting there by adding more tests. For previous struggles, see #625, #627 and the "final" fix in cb1b32f. I've added a failing test in the branch |
A workaround is renaming the template for HtmlWebpackPlugin. For example:
So the template does not get interpreted as index in the contentBase path. |
Also, the test I wrote earlier was not correct. Ref #640
This should be fixed with |
works for me, thanks! |
Works for me too. |
Works! |
I'm submitting a bug report
webpack and webpack-dev-server version:
webpack: 2 beta 25
webpack-dev-server: 2 beta 8
Please tell us about your environment:
macOS Sierra
Running via NPM script (AKA CLI)
Current behavior:
Loading a path (that is not root) directly (say
localhost:8080/about
) or refreshing it, will render theindex.html
as expected but the html webpack plugin will never inject the script tags with the bundle.Expected/desired behavior:
Loading the
localhost:8080/about
should render theindex.html
and have all the scripts injected into it.If you want to reproduce it, clone this starter, install the dependencies, run
npm start
, go to /about and refresh it.It should render the about page and not the index.html with the Loading... part.
I was unsure whether this is a bug at dev-server or html webpack plugin, but since the plugin is able to inject the stuff in the root path (or after a bundle) I think the bug relies on the dev server.
If you check the devServer config, you can see:
If I remove the
contentBase
(and move the index.html) it works.I am using the
contentBase
to serve also the assets, so all the images can be loaded directly from there.I could potentially remove the
contentBase
and fix things around but this is definitely a bug.The text was updated successfully, but these errors were encountered: