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

Default publicPath value, relative publicPath #28

Closed
saskodh opened this issue Aug 23, 2017 · 3 comments
Closed

Default publicPath value, relative publicPath #28

saskodh opened this issue Aug 23, 2017 · 3 comments

Comments

@saskodh
Copy link

saskodh commented Aug 23, 2017

Hi,
thanks for writing this loader. It integrates nicely in our Webpack configuration.
However I've noticed a small issue connected with the default value of the publicPath.

According to the Webpack docs the default value for publicPath is an empty string, which means relative to the page. This is the case in my app and in the production build I omit defining the publicPath. When using this loader in the urls for the font I have absolute url (starting with /). I suppose the issue is on this line.

Note: If the path is relative in the urls for the fonts, through the css-loader, Webpack will require the file and fail because the file does not exists. Any ideas on how we can fix this?

@goerwin
Copy link

goerwin commented Aug 28, 2017

I'm having the same issue, if the output.publicPath option is omitted or an empty string, I expect all my urls to resolve in "relative" way. However, this loader prefixes the font urls with /

@saskodh
Copy link
Author

saskodh commented Aug 28, 2017

@erwingo, I found a temporary workaround for this. It might helpful also for you.

  • set publicPath='./'
  • disable url requires for the css-loader: { loader: 'css-loader', options: { url: false } }

@goerwin
Copy link

goerwin commented Aug 28, 2017

@saskodh thank you! I tried with that publicPath but what was missing was the css-loader config.

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