grunt-contrib-cssmin icon indicating copy to clipboard operation
grunt-contrib-cssmin copied to clipboard

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

Open felicienfrancois opened this issue 9 years ago • 6 comments

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

felicienfrancois avatar Feb 17 '15 17:02 felicienfrancois

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

arthurvr avatar Mar 25 '15 13:03 arthurvr

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

  • grunt-contrib-cssmin v0.12.2
  • grunt-cli v0.1.13
  • grunt v0.4.5
  • iojs v1.4.3
  • windows 8.1 64bit

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

felicienfrancois avatar Mar 25 '15 13:03 felicienfrancois

+1, i'm reproducing the same error

  • grunt-contrib-cssmin 0.12.2
  • grunt 0.4.5
  • mac os 10.10.2

benoitemile avatar Apr 13 '15 13:04 benoitemile

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 avatar Feb 23 '17 21:02 trkoch

Works with [email protected].

trkoch avatar Feb 23 '17 21:02 trkoch

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

carsonreinke avatar Nov 22 '17 16:11 carsonreinke