babel-plugin-styled-components
Advanced tools
Comparing version 2.0.5 to 2.0.6
@@ -27,6 +27,6 @@ "use strict"; | ||
if (state.customImportName && !localNameCache[cacheKey]) { | ||
if (!bypassCache && cacheKey in localNameCache) { | ||
return localNameCache[cacheKey]; // state.customImportName is injected by the babel macro | ||
} else if (state.customImportName) { | ||
return state.customImportName.name; | ||
} else if (!bypassCache && localNameCache[cacheKey]) { | ||
return localNameCache[cacheKey]; | ||
} | ||
@@ -33,0 +33,0 @@ |
@@ -48,4 +48,6 @@ "use strict"; | ||
if (path.node.name.name !== 'css') return; | ||
const program = state.file.path; | ||
let importName = (0, _detectors.importLocalName)('default', state); | ||
const program = state.file.path; // state.customImportName is passed through from styled-components/macro if it's used | ||
// since the macro also inserts the import | ||
let importName = state.customImportName || (0, _detectors.importLocalName)('default', state); | ||
const { | ||
@@ -55,3 +57,3 @@ bindings | ||
if (!importName) { | ||
if (!importName || !bindings[importName.name] || !bindings[importName]) { | ||
(0, _helperModuleImports.addDefault)(path, 'styled-components', { | ||
@@ -58,0 +60,0 @@ nameHint: 'styled' |
{ | ||
"version": "2.0.5", | ||
"version": "2.0.6", | ||
"name": "babel-plugin-styled-components", | ||
@@ -4,0 +4,0 @@ "description": "Improve the debugging experience and add server-side rendering support to styled-components", |
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
40961
726