Skip to content

Commit

Permalink
Merge pull request #74 from mtsmfm/master
Browse files Browse the repository at this point in the history
Return fileName to have sass-loader handle dependency correctly
  • Loading branch information
pmowrer authored Sep 28, 2018
2 parents 5badc3a + 3d34986 commit f99f849
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 4.1.0

- Return `fileName` to have sass-loader handle dependency correctly (#74).

## 4.0.1
* Update package.json's main field (#73).

Expand Down
1 change: 1 addition & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export default function(options = {}) {

return {
contents: transformJSONtoSass(json),
file: fileName,
};
} catch(error) {
return new Error(`node-sass-json-importer: Error transforming JSON/JSON5 to SASS. Check if your JSON/JSON5 parses correctly. ${error}`);
Expand Down
4 changes: 4 additions & 0 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ describe('node-sass-json-importer', function() {
});

expect(result.css.toString()).to.eql(EXPECTATION);
expect(result.stats.includedFiles).to.eql([
resolve('./test/fixtures/strings/style.scss'),
resolve('./test/fixtures/strings/variables.json'),
].sort());
});

// TODO: Added to verify named exports + CommonJS default export hack (see index.js).
Expand Down

0 comments on commit f99f849

Please sign in to comment.