Skip to content

publicPath doesn't seem to be honoured when loading CSS #2

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

Closed
insin opened this issue Mar 4, 2018 · 2 comments
Closed

publicPath doesn't seem to be honoured when loading CSS #2

insin opened this issue Mar 4, 2018 · 2 comments

Comments

@insin
Copy link

insin commented Mar 4, 2018

mini-css-extract-plugin@0.1.0

Using an app with a router, which splits code per route and has publicPath: '/' in its output options, I'm seeing the following inserted into <head> when visiting a route which imports CSS:

firefox_2018-03-04_22-00-22

If I log out outputOptions in loader.js it looks ok, but don't know what's ultimately responsible for creating the full path in the compilation.createChildCompiler or NodeTemplatePlugin it gets passed to:

{ outputOptions: { filename: '*', publicPath: '/' } }
@Jessidhia
Copy link
Contributor

Jessidhia commented Mar 5, 2018

It seems that the plugin's output doesn't take into account the __webpack_public_path__.

Compare this line in the extracted CSS output:

linkTag.href = "" + ({"id":"name"}[chunkId]||chunkId) + ".css";

with:

script.src = __webpack_require__.p + "" + ({"id":"name"}[chunkId]||chunkId) + ".js";

For [name].js / [name].css outputs. The __webpack_require__.p is where the runtime value of __webpack_public_path__ is kept.

@ganapativs
Copy link
Contributor

Same issue here.

@sokra sokra closed this as completed in #7 Mar 5, 2018
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

3 participants