Skip to content
This repository has been archived by the owner on Sep 11, 2018. It is now read-only.

Referencing /static/* doesnt work on windows #862

Closed
m4recek opened this issue Jun 14, 2016 · 4 comments
Closed

Referencing /static/* doesnt work on windows #862

m4recek opened this issue Jun 14, 2016 · 4 comments

Comments

@m4recek
Copy link

m4recek commented Jun 14, 2016

Hi,
we have a problem with files under /static/* directory. When we reference them in scss files they are not loaded. e.g. background-image: url('/me.jpg').

  • They are properly served by webserver. I can access localhost:3000/me.jpg and it works
  • They are properly copied to /dist/ directory when npm run deploy is run
  • They are not loaded/visible in development when referenced as /me.jpg in scss files but work when referenced as http://localhost:3000/me.jpg

How should we get them working in develoment mode?

I've been searching a bit more and it seems same as #696, maybe its because scss bundle is served from blob:http://... so image has wrong protocol...

@m4recek
Copy link
Author

m4recek commented Jun 16, 2016

Did a bit more testing today and found this.

  1. if you reference something static in /styles/ outside of :global { } block as static/something.jpg it works
  2. if you do very same think inside :global {} block it doesnt work

@s1ddh1k
Copy link

s1ddh1k commented Jun 24, 2016

To avoid this, you should remove sourceMap options for css-loader.

Ref: webpack-contrib/style-loader#124

@tlaak
Copy link

tlaak commented Jun 27, 2016

This problem also exists on a Mac. There is a workaround (webpack-contrib/style-loader#96 (comment)), but I'm haven't managed to get it to work with this starter-kit.

@dvdzkwsk
Copy link
Owner

Closing since static and css modules have been moved and removed, respectively.

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

4 participants