Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 10bc4d9

Browse files
fix: realtive imports
Co-Authored-By: James Talmage <[email protected]>
1 parent 1c0e9f9 commit 10bc4d9

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,10 @@ module.exports = (css, settings) => {
2121
// clean up extra indent (indentedSyntax is not compatible with extra indenting)
2222
// they need to be cleaned up separately, and than concated
2323
const data = stripIndent(optionData) + '\n' + stripIndent(cssWithPlaceholders)
24+
const file = settings.babel && settings.babel.filename
2425

2526
const preprocessed = sass
26-
.renderSync(Object.assign({}, settings.sassOptions, { data }))
27+
.renderSync(Object.assign({}, { file }, settings.sassOptions, { data }))
2728
.css.toString()
2829

2930
return preprocessed

test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -122,12 +122,7 @@ describe('styled-jsx-plugin-sass', () => {
122122
const file = fs.readFileSync(path.join(__dirname, filename))
123123

124124
assert.equal(
125-
plugin(file.toString(), {
126-
sassOptions: {
127-
includePaths: [path.join(__dirname, 'fixtures')]
128-
},
129-
babel: { filename }
130-
}).trim(),
125+
plugin(file.toString(), { babel: { filename } }).trim(),
131126
cleanup(`
132127
* {
133128
font-family: "Comic Sans MS" !important; }

0 commit comments

Comments
 (0)