From d9a78f5f7e5d9a1f50aa939a404e51494270bb5f Mon Sep 17 00:00:00 2001 From: Jimmy King Date: Tue, 14 Jan 2014 13:16:20 -0700 Subject: [PATCH] Fixed #4 --- History.md | 4 ++++ README.md | 4 ++-- package.json | 2 +- src/sass.plugin.coffee | 20 ++++++++++---------- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/History.md b/History.md index e775c01..90aa32a 100644 --- a/History.md +++ b/History.md @@ -1,5 +1,9 @@ ## History +- v2.2.1 Jan 14, 2014 + - Fixed [#4](https://github.com/jking90/docpad-plugin-nodesass/issues/4) + - Updated [node-sass](https://github.com/andrew/node-sass) to 0.8.1 + - v2.2.0 Jan 13, 2014 - Updated [node-sass](https://github.com/andrew/node-sass) to 0.8.0 - Added support for sourcemaps diff --git a/README.md b/README.md index 9a5c3c5..5ce6b13 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Build Status](https://travis-ci.org/jking90/docpad-plugin-nodesass.png?branch=master)](https://travis-ci.org/jking90/docpad-plugin-nodesass) [![Gittip donate button](http://img.shields.io/gittip/jking90.png)](https://www.gittip.com/jking90/ "Donate weekly to this project using Gittip") -Adds support for the [SCSS](http://sass-lang.com/) CSS pre-processor to [DocPad](https://docpad.org). +> Adds support for the [SCSS](http://sass-lang.com/) CSS pre-processor to [DocPad](https://docpad.org). The indented `.sass` syntax is not supported by [node-sass](https://github.com/andrew/node-sass), so it is not supported by this plugin. @@ -20,7 +20,7 @@ npm install --save docpad-plugin-nodesass ### Output Style -This option is not supported by [`libsass`](https://github.com/hcatlin/libsass) (and neither are sourcemaps). +This option is not supported by [`libsass`](https://github.com/hcatlin/libsass). ### Bourbon diff --git a/package.json b/package.json index a93ab3d..e415a55 100644 --- a/package.json +++ b/package.json @@ -42,7 +42,7 @@ }, "dependencies": { "taskgroup": "~3.3.6", - "node-sass": "~0.8", + "node-sass": "~0.8.1", "node-bourbon": "~1.0.0", "node-neat": "~1.1.0", "mkdirp": "~0.3.5" diff --git a/src/sass.plugin.coffee b/src/sass.plugin.coffee index 657d774..61f99bb 100644 --- a/src/sass.plugin.coffee +++ b/src/sass.plugin.coffee @@ -14,7 +14,6 @@ module.exports = (BasePlugin) -> name: 'nodesass' # Plugin config - # Only on the development environment use expanded, otherwise use compressed config: bourbon: false debugInfo: false @@ -22,9 +21,6 @@ module.exports = (BasePlugin) -> neat: false renderUnderscoreStylesheets: false sourceMap: false - environments: - development: - debugInfo: 'normal' # Generate Before generateBefore: (opts,next) -> @@ -69,16 +65,20 @@ module.exports = (BasePlugin) -> # Define callback fn callback = (css, map) -> if map - mkdirp file.get('outDirPath'), (err)-> - if err - console.log err - path = file.get('outPath') + '.map' - fs.writeFile path, map, (err)-> + fileName = path.split('/').pop() + + # Create dir for sourcemap + mkdirp file.get('outDirPath'), (err)-> if err console.log err + else + # Write sourcemap + fs.writeFile path, map, (err)-> + if err + console.log err - fileName = path.split('/').pop() + # Include sourcemap URL in CSS file css = '/*# sourceMappingURL=./' + fileName + ' */\n' + css opts.content = css