Skip to content

Commit

Permalink
fix: issues: Fails for import statement with no name a-x-#2
Browse files Browse the repository at this point in the history
  • Loading branch information
sarapli committed Feb 8, 2020
1 parent 11e1208 commit 5e4e65c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,18 @@ module.exports = function(/*babel*/) {
// const jssObject = cssToJss({ code });
// writeJssFile(jssObject, src);

babelData.replaceWithMultiple([
classesMapConstAst({ classesMap, importNode }),
putStyleIntoHeadAst({ code }),
]);
// issues: Fails for import statement with no name #2
if (importNode.local) {
babelData.replaceWithMultiple([
classesMapConstAst({ classesMap, importNode }),
putStyleIntoHeadAst({ code }),
]);
} else {
babelData.replaceWithMultiple([
putStyleIntoHeadAst({ code }),
]);
}

}),
},
},
Expand Down

0 comments on commit 5e4e65c

Please sign in to comment.