We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
anymaniax
melloware
soartec-lab
Learn more about funding links in repositories.
Report abuse
1 parent 67bf84f commit c42fcdaCopy full SHA for c42fcda
packages/core/src/generators/imports.ts
@@ -181,9 +181,12 @@ export const addDependency = ({
181
hasSchemaDir: boolean;
182
isAllowSyntheticDefaultImports: boolean;
183
}) => {
184
- const toAdds = exports.filter((e) =>
185
- implementation.includes(e.alias || e.name),
186
- );
+ const toAdds = exports.filter((e) => {
+ const searchWords = [e.alias, e.name].filter((p) => p?.length).join('|');
+ const pattern = new RegExp(`\\b(${searchWords})\\b`, 'g');
187
+
188
+ return implementation.match(pattern);
189
+ });
190
191
if (!toAdds.length) {
192
return undefined;
0 commit comments