Skip to content

Commit

Permalink
Fixed #4
Browse files Browse the repository at this point in the history
  • Loading branch information
Jimmy King committed Jan 14, 2014
1 parent a78ef29 commit d9a78f5
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
4 changes: 4 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
20 changes: 10 additions & 10 deletions src/sass.plugin.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,13 @@ module.exports = (BasePlugin) ->
name: 'nodesass'

# Plugin config
# Only on the development environment use expanded, otherwise use compressed
config:
bourbon: false
debugInfo: false
#outputStyle: 'compressed'
neat: false
renderUnderscoreStylesheets: false
sourceMap: false
environments:
development:
debugInfo: 'normal'

# Generate Before
generateBefore: (opts,next) ->
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit d9a78f5

Please sign in to comment.