Skip to content

Commit ee59f86

Browse files
authored
feat: handle double quotes lodash imports (#4)
* Handle double quotes imports I've found this code from https://github.com/mikeduminy/esbuild-plugin-ramda/blob/main/index.js#L18. Thank you @mikeduminy ! * Update index.js * Update index.js
1 parent ed47c2b commit ee59f86

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function pluginLodashImport(options = {}) {
1515
const extension = path.extname(args.path).replace('.', '');
1616
const loader = JS_EXTENSIONS.has(extension) ? 'jsx' : extension;
1717

18-
const lodashImportRegex = /import\s+?(?:(?:(?:[\w*\s{},]*)\s+from\s+?)|)(?:(?:'lodash\/?.*?'))[\s]*?(?:;|$|)/g;
18+
const lodashImportRegex = /import\s+?(?:(?:(?:[\w*\s{},]*)\s+from\s+?)|)[\'\"](?:(?:lodash\/?.*?))[\'\"][\s]*?(?:;|$|)/g;
1919

2020
const lodashImports = contents.match(lodashImportRegex);
2121

0 commit comments

Comments
 (0)