Skip to content

Commit c7c5d99

Browse files
refactor: Merge import and export regex (#33)
1 parent f87d53a commit c7c5d99

4 files changed

Lines changed: 5 additions & 15 deletions

File tree

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export * from '@tanstack/query-core';
22
export * from './use-client.cjs';
3-
export * from './nested/nested.cjs';
3+
export { test } from './nested/nested.cjs';
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export * from '@tanstack/query-core';
22
export * from './use-client.js';
3-
export * from './nested/nested.js';
3+
export { test } from './nested/nested.js';

integrations/react/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export * from '@tanstack/query-core'
22
export * from './use-client'
3-
export * from './nested/nested'
3+
export { test } from './nested/nested'

src/build/index.js

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,7 @@ export const tanstackBuildConfig = (options) => {
2626
},
2727
beforeWriteFile: (filePath, content) => {
2828
content = content.replace(
29-
/^import\s[\w{}*\s,]+from\s['"]\.\/[^.'"]+(?=['"];?$)/gm,
30-
'$&.js',
31-
)
32-
33-
content = content.replace(
34-
/^export\s[\w{}*\s,]+from\s['"]\.\/[^.'"]+(?=['"];?$)/gm,
29+
/^(im|ex)port\s[\w{}*\s,]+from\s['"]\.\/[^.'"]+(?=['"];?$)/gm,
3530
'$&.js',
3631
)
3732

@@ -50,12 +45,7 @@ export const tanstackBuildConfig = (options) => {
5045
},
5146
beforeWriteFile: (filePath, content) => {
5247
content = content.replace(
53-
/^import\s[\w{}*\s,]+from\s['"]\.\/[^.'"]+(?=['"];?$)/gm,
54-
'$&.cjs',
55-
)
56-
57-
content = content.replace(
58-
/^export\s[\w{}*\s,]+from\s['"]\.\/[^.'"]+(?=['"];?$)/gm,
48+
/^(im|ex)port\s[\w{}*\s,]+from\s['"]\.\/[^.'"]+(?=['"];?$)/gm,
5949
'$&.cjs',
6050
)
6151

0 commit comments

Comments
 (0)