babel-plugin-emotion-rename
Advanced tools
Comparing version 1.0.0-beta.20 to 1.0.0-beta.21
@@ -14,3 +14,3 @@ "use strict"; | ||
function getStyled(path) { | ||
if (path.node.source.value !== "react-emotion") { | ||
if (path.node.source.value !== "react-emotion" && path.node.source.value !== "emotion") { | ||
return { | ||
@@ -164,3 +164,3 @@ hasStyled: [], | ||
path.node.source = t.stringLiteral("@emotion/css"); | ||
} else if (importPackageName === "react-emotion") { | ||
} else if (importPackageName === "react-emotion" || importPackageName == "emotion") { | ||
var _path$node$specifiers, _path$node$specifiers2, _styledDefaultNode$lo; | ||
@@ -267,7 +267,12 @@ var cssLocalName = (_path$node$specifiers = path.node.specifiers.find(function (s) { | ||
*/ | ||
if (path.scope.bindings.styled && /(react-)?emotion/.test(node.arguments[0].value)) { | ||
path.node.arguments = [t.stringLiteral("@emotion/styled")]; | ||
return; | ||
} | ||
// if ( | ||
// path.scope.bindings.styled && | ||
// /(react-)?emotion/.test(node.arguments[0].value) | ||
// ) { | ||
// path.node.arguments = [t.stringLiteral("@emotion/styled")]; | ||
// return; | ||
// } | ||
path.node.arguments = [t.stringLiteral("@emotion/css")]; | ||
// path.node.arguments = [ | ||
@@ -274,0 +279,0 @@ // source(node.arguments[0].value, original, replacement), |
{ | ||
"name": "babel-plugin-emotion-rename", | ||
"version": "1.0.0-beta.20", | ||
"version": "1.0.0-beta.21", | ||
"description": "Babel plugin to rename old Emotion 9 import to new Emotion 10+ import", | ||
@@ -5,0 +5,0 @@ "main": "lib/index", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16746
283