babel-plugin-styled-components
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -6,3 +6,3 @@ "use strict"; | ||
}); | ||
exports.useTranspileTemplateLiterals = exports.useTopLevelImportPathMatchers = exports.useSSR = exports.usePureAnnotation = exports.useNamespace = exports.useMinify = exports.useFileName = exports.useDisplayName = exports.useCssProp = void 0; | ||
exports.useTranspileTemplateLiterals = exports.useTopLevelImportPathMatchers = exports.useSSR = exports.usePureAnnotation = exports.useNamespace = exports.useMinify = exports.useMeaninglessFileNames = exports.useFileName = exports.useDisplayName = exports.useCssProp = void 0; | ||
@@ -31,2 +31,6 @@ function getOption({ | ||
const useMeaninglessFileNames = state => getOption(state, 'meaninglessFileNames', ['index']); | ||
exports.useMeaninglessFileNames = useMeaninglessFileNames; | ||
const useMinify = state => getOption(state, 'minify'); | ||
@@ -33,0 +37,0 @@ |
@@ -69,6 +69,6 @@ "use strict"; | ||
const getBlockName = file => { | ||
const getBlockName = (file, meaninglessFileNames) => { | ||
const name = _path.default.basename(file.opts.filename, _path.default.extname(file.opts.filename)); | ||
return name !== 'index' ? name : _path.default.basename(_path.default.dirname(file.opts.filename)); | ||
return meaninglessFileNames.includes(name) ? _path.default.basename(_path.default.dirname(file.opts.filename)) : name; | ||
}; | ||
@@ -83,3 +83,3 @@ | ||
if (file) { | ||
const blockName = getBlockName(file); | ||
const blockName = getBlockName(file, (0, _options.useMeaninglessFileNames)(state)); | ||
@@ -86,0 +86,0 @@ if (blockName === componentName) { |
@@ -110,3 +110,3 @@ "use strict"; | ||
elem.node.attributes = elem.node.attributes.filter(x => t.isJSXAttribute(x) ? x.name.name !== 'css' : false); | ||
elem.node.attributes = elem.node.attributes.filter(x => t.isJSXSpreadAttribute(x) || (t.isJSXAttribute(x) ? x.name.name !== 'css' : false)); | ||
elem.node.name = t.jSXIdentifier(id.name); | ||
@@ -113,0 +113,0 @@ |
{ | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"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
40829
724