Skip to content
This repository has been archived by the owner on Apr 8, 2020. It is now read-only.

Webpack's publicPath isn't used #176

Closed
Tragetaschen opened this issue Jul 13, 2016 · 2 comments
Closed

Webpack's publicPath isn't used #176

Tragetaschen opened this issue Jul 13, 2016 · 2 comments

Comments

@Tragetaschen
Copy link

I'm using the html-loader for my angular 2 templates and that replaces for example <img src> paths with their server path. When I'm running my app in the browser, the publicPath is correctly used as expected. When running on the server, there is no publicPath at all (__webpack_require__.p seems to be the empty string / null / undefined).
That means, my browser renders <img src="/dist/9a08c41631a395a808e4d9d7b7b68d63.jpg"/>, the server just renders <img src="9a08c41631a395a808e4d9d7b7b68d63.jpg"/>.

@SteveSandersonMS
Copy link
Member

Thanks for reporting this. The issue was that the aspnet-webpack module overrode the output section of your config when performing in-memory compilation, which meant it didn't pass through your path or publicPath values into the compiler.

I've just published an updated aspnet-webpack NPM module - the new version number is 1.0.6. If you update to this version, hopefully you'll find things start working as expected.

@Tragetaschen
Copy link
Author

Indeed, they do. Thanks!

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

No branches or pull requests

2 participants