Skip to content

Commit f99f849

Browse files
authored
Merge pull request #74 from mtsmfm/master
Return fileName to have sass-loader handle dependency correctly
2 parents 5badc3a + 3d34986 commit f99f849

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 4.1.0
4+
5+
- Return `fileName` to have sass-loader handle dependency correctly (#74).
6+
37
## 4.0.1
48
* Update package.json's main field (#73).
59

src/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export default function(options = {}) {
3636

3737
return {
3838
contents: transformJSONtoSass(json),
39+
file: fileName,
3940
};
4041
} catch(error) {
4142
return new Error(`node-sass-json-importer: Error transforming JSON/JSON5 to SASS. Check if your JSON/JSON5 parses correctly. ${error}`);

test/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ describe('node-sass-json-importer', function() {
2020
});
2121

2222
expect(result.css.toString()).to.eql(EXPECTATION);
23+
expect(result.stats.includedFiles).to.eql([
24+
resolve('./test/fixtures/strings/style.scss'),
25+
resolve('./test/fixtures/strings/variables.json'),
26+
].sort());
2327
});
2428

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

0 commit comments

Comments
 (0)