gruntjs / grunt-contrib-cssmin

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

Build fail when sourceMap is enabled and source files contains embedded sourcemap #178

Open felicienfrancois opened 9 years ago

felicienfrancois commented 9 years ago

At the end of one of my source files:

...
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uI.....jc3MifQ== */

When activating sourceMap = true, I get the following error:

Running "cssmin:dev" (cssmin) task
>> Error: ENOENT, no such file or directory 'myproject/data:application/json;base64,eyJ2ZXJzaW9uI.....jc3MifQ
Warning: CSS minification failed Use --force to continue.

Aborted due to warnings.

To reproduce, just try to minify the following file with option sourceMap = true https://github.com/l-lin/font-awesome-animation/blob/master/dist/font-awesome-animation.css

arthurvr commented 9 years ago

I just tested and at the moment I am unable to reproduce this. What version of the task are you using?

felicienfrancois commented 9 years ago

I'm able to reproduce it with the following setup:

source file: font-awesome-animation v0.0.6 installed with bower

Grunfile.js:

...
cssmin: {
  test: {
    options: {
      sourceMap: true
    },
    files: {
      'output.css': ["bower_components/font-awesome-animation/dist/font-awesome-animation.css"]
    }
  }
},
...

Command: grunt cssmin:test

benoitemile commented 9 years ago

+1, i'm reproducing the same error

trkoch commented 7 years ago

I'm experiencing a similar, ~possibly related error~.

>> Error: Invalid mapping: {"generated":{"line":1,"column":7296},"source":"../../Private/Stylesheets/bootstrap/mixins/_clearfix.scss","original":{"line":14,"column":-10},"name":null}

It used to work with

I have no idea why grunt was downgraded (no changes in package.json)

{
  // ...
  "grunt": "^1.0.1",
  // ...
}

Please let me know if the full list of packages (npm list) can be of help.

trkoch commented 7 years ago

Works with node-sass@3.10.1.

carsonreinke commented 6 years ago

This is still an issue with a source map generated from SaSS