Skip to content

Commit

Permalink
v1.0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
nathancahill committed Apr 28, 2017
1 parent 453ec19 commit 99bf97e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
28 changes: 15 additions & 13 deletions dist/rollup-plugin-collect-sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,22 +173,24 @@ var index = function (options) {
match = findRegex.exec(source);
}

// Transform sass
var css = sass.renderSync({
data: accum,
includePaths: ['node_modules'],
}).css.toString();

if (!extract) {
var injected = injectFnName + "(" + (JSON.stringify(css)) + ");";
if (accum) {
// Transform sass
var css = sass.renderSync({
data: accum,
includePaths: ['node_modules'],
}).css.toString();

if (!extract) {
var injected = injectFnName + "(" + (JSON.stringify(css)) + ");";

// Replace first instance with output. Remove all other instances
return source.replace(replaceRegex, injected).replace(findRegex, '')
}

// Replace first instance with output. Remove all other instances
return source.replace(replaceRegex, injected).replace(findRegex, '')
// Store css for writing
cssExtract = css;
}

// Store css for writing
cssExtract = css;

// Remove all other instances
return source.replace(findRegex, '')
},
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rollup-plugin-collect-sass",
"version": "1.0.2",
"version": "1.0.3",
"description": "Transform Sass in a single context",
"main": "dist/rollup-plugin-collect-sass.js",
"files": "dist",
Expand Down

0 comments on commit 99bf97e

Please sign in to comment.