Skip to content

Commit 62aa2e3

Browse files
committed
Merge branch 'master' of github.com:giuseppeg/styled-jsx-plugin-sass
2 parents a440627 + e0175b9 commit 62aa2e3

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

index.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ module.exports = (css, settings) => {
1010
`/*%%styled-jsx-placeholder-${id}%%*/`
1111
)
1212

13-
// Add the directory containing the current file to includePaths to enable relative
14-
// imports, only works when the filename is provided
15-
const includePaths = settings.sassOptions && settings.sassOptions.includePaths || [];
16-
17-
if (settings.babel && settings.babel.filename) {
18-
includePaths.push(path.dirname(settings.babel.filename));
19-
}
20-
2113
// Prepend option data to cssWithPlaceholders
2214
const optionData = settings.sassOptions && settings.sassOptions.data || "";
2315
const data = optionData + "\n" + cssWithPlaceholders;
@@ -26,8 +18,7 @@ module.exports = (css, settings) => {
2618
Object.assign(
2719
{},
2820
settings.sassOptions,
29-
{ data },
30-
{ includePaths }
21+
{ data }
3122
)).css.toString()
3223

3324
return preprocessed

test.js

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

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

0 commit comments

Comments
 (0)