Skip to content

Commit

Permalink
[build] 0.8.1
Browse files Browse the repository at this point in the history
  • Loading branch information
differui committed Jun 27, 2018
1 parent da80fea commit a54ced5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
18 changes: 11 additions & 7 deletions dist/rollup-plugin-sass.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function insertStyle(css) {
return css;
}

var MATHC_SASS_FILENAME_RE = /\.sass$/;
var MATCH_SASS_FILENAME_RE = /\.sass$/;
var MATCH_NODE_MODULE_RE = /^~([a-z0-9]|@).+/i;

function plugin() {
Expand Down Expand Up @@ -86,7 +86,7 @@ function plugin() {
return pify(sassRuntime.render.bind(sassRuntime))(_Object$assign({}, customizedSassOptions, {
file: id,
data: customizedSassOptions.data && '' + customizedSassOptions.data + code,
indentedSyntax: MATHC_SASS_FILENAME_RE.test(id),
indentedSyntax: MATCH_SASS_FILENAME_RE.test(id),
includePaths: customizedSassOptions.includePaths ? customizedSassOptions.includePaths.concat(paths) : paths,
importer: [function (url, importer, done) {
if (!MATCH_NODE_MODULE_RE.test(url)) {
Expand All @@ -99,11 +99,15 @@ function plugin() {
extensions: ['.scss', '.sass']
};

pify(resolve)(moduleUrl, resolveOptions).then(function (id) {
return done({ file: id });
}).catch(function () {
return done({ file: url });
});
try {
done({
file: resolve.sync(moduleUrl, resolveOptions)
});
} catch (err) {
done({
file: url
});
}
}].concat(customizedSassOptions.importer || [])
}));

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-sass",
"version": "0.8.0",
"version": "0.8.1",
"description": "Rollup .sass files.",
"main": "dist/rollup-plugin-sass.js",
"scripts": {
Expand Down

0 comments on commit a54ced5

Please sign in to comment.