0

I write Sass and use grunt-pleeease to inline @includes etc. Unfortunately pleeease inlines its source map and ignores the existing one.

The source map file from sass is in the same folder as the css I pass to pleeease (main.css and main.css.map)

Is there a way to tell pleeease to use the existing source map and extend it?

Thomas
  • 8,426
  • 1
  • 25
  • 49

1 Answers1

0

I've also run into this problem. Currently, the pleeease grunt task doesn't write out the external source map even if you select the correct options. You can edit the task to make it do this anyway. I've submitted a pull request to the project on GitHub for this fix.

Note that I still had to specify the in and out options (pleeease gets the location of the original source map from the css file's sourcemap comment; you can specify this manually also using the prev option for sourcemaps, just note that you have to set that option to the contents of the sourcemap file, not the path of the sourcemap file--grunt.file.read() will be of use there):

pleeease: { dist: { options: { in: 'build/styles/styles.css', out: 'public/styles/styles.min.css', sourcemaps: { map: { inline: false, sourcesContent: true } } }, files: { 'public/styles/styles.min.css': 'build/styles/styles.css' } } },

Until this fix is implemented into the master branch and published on NPM, you can use the GitHub address of my pull request branch in your package.json to get the fix (please note that I will eventually remove this branch if my pull request is accepted or the fix is achieved in some other way):

"grunt-pleeease": "zeorin/grunt-pleeease#sourcemap-external",

Xandor Schiefer
  • 303
  • 3
  • 10