Skip to content

Commit

Permalink
fix: issues: Fails for import statement with no name #2 (#4)
Browse files Browse the repository at this point in the history
Co-authored-by: sarapli <[email protected]>
  • Loading branch information
Sara2009 and sarapli authored Jul 17, 2020
1 parent fc3f159 commit 86641b6
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 86641b6

Please sign in to comment.