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

Images don't show as background-image when using css-loader sourceMap option #81

Closed
drawveloper opened this issue Mar 21, 2016 · 11 comments
Labels

Comments

@drawveloper
Copy link
Contributor

Reported here: webpack-contrib/css-loader#216
Discussed here: webpack-contrib/style-loader#55

I simply removed sourceMap from my build. I think it's worth it at least documenting this big caveat, but I'd vote to remove CSS sourceMap completely.

@coryhouse coryhouse added the bug label Mar 21, 2016
@coryhouse
Copy link
Owner

I see multiple options:

  1. Disable css sourcemap
  2. Disable css minification so we don't need the sourcemap
  3. Advise using absolute paths for images
  4. Leave as is and wait for a fix - though appears unclear if one is in the works

I lean toward option 2. Option 1 means debugging CSS would be difficult. Thoughts?

@drawveloper
Copy link
Contributor Author

Minifying only in production build sounds good. (Without sourcemaps)

On Mon, Mar 21, 2016 at 12:43 PM Cory House notifications@github.com
wrote:

I see multiple options:

  1. Disable css sourcemap
  2. Disable css minification so we don't need the sourcemap
  3. Advise using absolute paths for images
  4. Leave as is and wait for a fix - though appears unclear if one is
    in the works

I lean toward option 2. Option 1 means debugging CSS would be difficult.
Thoughts?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#81 (comment)

@coryhouse
Copy link
Owner

Just occurred to me - the reason sourcemaps are so useful is we're compiling from SASS. So without them, you're lost during dev. Now I'm torn. We basically have a choice between:

  1. Disable sourcemaps, which provides a bad CSS debugging experience for all
  2. Keep sourcemaps, and let those with this issue use absolute paths or wait for a fix.

After thinking about this more, I think keeping sourcemaps on is the best approach. We'd certainly want them if it weren't for this (hopefully short-term) bug.

@drawveloper
Copy link
Contributor Author

I'd just like to add that "those with this issue" should be 100% of people
working on a real world app. How can you not use background-image? :)

At least we should have a FAQ in the README, I guess.

On Mon, Mar 21, 2016 at 1:57 PM Cory House notifications@github.com wrote:

Just occurred to me - the reason sourcemaps are so useful is we're
compiling from SASS. So without them, you're lost during dev. Now I'm torn.
We basically have a choice between:

  1. Disable sourcemaps, which provides a bad CSS debugging experience
    for all
  2. Keep sourcemaps, and let those with this issue use absolute paths
    or wait for a fix.

After thinking about this more, I think keeping sourcemaps on is the best
approach. We'd certainly want them if it weren't for this (hopefully
short-term) bug.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#81 (comment)

@lovio
Copy link

lovio commented Apr 7, 2016

Just disable css sourceMaps and it works

@zsherman
Copy link

I'd also vote for option #2 fwiw.

@Strate
Copy link

Strate commented Apr 28, 2016

This is a fix webpack-contrib/style-loader#96

@coryhouse
Copy link
Owner

@Strate Great to hear! Hopefully they accept that PR soon.

@kwelch
Copy link
Collaborator

kwelch commented Jul 22, 2016

PR #207 uses the fix quick fix discussed in webpack-contrib/style-loader#96, so this item should be resolved. I can re-test to verify.

@kwelch
Copy link
Collaborator

kwelch commented Jul 26, 2016

Validated with the update to set webpack path dynamically, relative background images work.

Closing.

@kwelch kwelch closed this as completed Jul 26, 2016
@coryhouse
Copy link
Owner

Awesome! Thanks Kyle!

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

No branches or pull requests

6 participants