gruntjs / grunt-contrib-cssmin

Compress CSS files.
http://gruntjs.com/
MIT License
793 stars 147 forks source link

Ignoring local source map #284

Closed oninross closed 7 years ago

oninross commented 7 years ago

It was working before I cloned my project to another computer and did an npm install. I am receiving a lot of error messages like the one below

>> Ignoring local source map at "CSS_MAP_FILE" as resource is missing.

Currently, im running grunt-contrib-cssmin@2.0.0. A colleague of mine is using grunt-contrib-cssmin@1.0.2 and its not receiving any errors.

This is troublesome for developers who need minified CSS files

josh-bradley commented 7 years ago

Had a similar issue, for me it was caused by a breaking change introduced in css-clean v4. css-clean v4 looks like it was added to cssmin after 1.0.2 so might be whats causing your issue.

If you were using the root, target or relativeTo options you'll need to change them to use the single rebaseTo. See here for details

https://github.com/jakubpawlowicz/clean-css#important-40-breaking-changes

XhmikosR commented 7 years ago

See the reply above.

davegreenwp commented 7 years ago

@hi @XhmikosR the comment made by @josh-bradley doesn't seem like it leads to a resolution for this issue in all cases.

I'm not using root, target or relativeTo options in my grunt-contrib-cssmin config and I'm still getting the same error:

Ignoring local source map at "/Users/dave/Downloads/kapow-test/style.css.map" as resource is missing.

I'm on version 2.2.0.

A sourcemap file called style.css.map resides in the same directory as the CSS file being minified, so it's not immediately obvious what the issue is.

Cheers!

codeengie commented 7 years ago

@hi @XhmikosR I'm having the same issue as @davetgreen. I'm on node 6.10.3 and cssmin 2.2.0.

josh-bradley commented 7 years ago

hey @davetgreen and @cvillanujr have you tried adding the rebaseTo option anyway, give it a value pointing to where your output files are going. If that does not work are you able to share your config?

codeengie commented 7 years ago

@josh-bradley I did and it did modify the map url but it also changes background image references which lead to broken images.

davegreenwp commented 7 years ago

hey @josh-bradley, I found that adding rebaseTo did actually resolve the issue, sorry I totally forgot to come back and report that! 👌