Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: pattern match of topLevelImportPaths was unanchored
This seems to have been a mistake in #354
  • Loading branch information
agriffis committed Dec 29, 2021
commit f6ddbddf20639116b53e0e9ed760b7ec07e98796
2 changes: 1 addition & 1 deletion src/utils/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function getOption({ opts }, name, defaultValue = true) {

export const useDisplayName = state => getOption(state, 'displayName')
export const useTopLevelImportPathMatchers = state =>
getOption(state, 'topLevelImportPaths', []).map(pattern => new RegExp(pattern))
getOption(state, 'topLevelImportPaths', []).map(pattern => new RegExp(`^${pattern}$`))
export const useSSR = state => getOption(state, 'ssr', true)
export const useFileName = state => getOption(state, 'fileName')
export const useMeaninglessFileNames = state => getOption(state, 'meaninglessFileNames', ['index'])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"ssr": true,
"topLevelImportPaths": [
"@xstyled/styled-components",
"@xstyled/styled-components/*"
"@xstyled/styled-components/.*"
],
"transpileTemplateLiterals": false
}
Expand Down