Css-loader: Overwrite publicPath

Created on 13 Feb 2016  Â·  5Comments  Â·  Source: webpack-contrib/css-loader

Is there a way to overwrite publicPath that CSS loader is using?

Most helpful comment

It is the https://github.com/webpack/extract-text-webpack-plugin that uses the output.publicPath to resolve URLs and there is options.publicPath to overwrite it.

All 5 comments

All our CSS assets are in a flat structure. Therefore all relative URLs are simply ./[asset name]. However, we serve static assets from ./static path relative to the current URL, therefore our output.publicPath is ./static/.

Unfortunately, CSS picks up the output.publicPath and attempts to resolve ./static/static/[asset name].

It is the https://github.com/webpack/extract-text-webpack-plugin that uses the output.publicPath to resolve URLs and there is options.publicPath to overwrite it.

@gajus Would you like to post your code ? I seemed to encounter the same question.

Sorry, it has been too long. Though as the former comment states, the solution is in the ExtractText config, not css-loader.

On Jun 20, 2016, at 20:06, Aflext Yang [email protected] wrote:

@gajus Would you like to post your code ? I seemed to encounter the same question.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@gajus Thanks a lot anyway!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

danielgomonea picture danielgomonea  Â·  3Comments

grydstedt picture grydstedt  Â·  3Comments

dmiller9911 picture dmiller9911  Â·  3Comments

mareksuscak picture mareksuscak  Â·  5Comments

callmez picture callmez  Â·  4Comments