Skip to content

Commit 0593b0f

Browse files
fix: run start compiler on imports from @tanstack/start-client-core
this allows writing framework agnostic code that e.g. uses `createIsomorphicFn`
1 parent 6a62499 commit 0593b0f

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • packages/start-plugin-core/src/start-compiler-plugin

‎packages/start-plugin-core/src/start-compiler-plugin/compilers.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,16 @@ export function compileStartOutputFactory(
5252
// find referenced identifiers *before* we transform anything
5353
const refIdents = doDce ? findReferencedIdentifiers(ast) : undefined
5454

55+
const validImportSources = [
56+
`@tanstack/${framework}-start`,
57+
'@tanstack/start-client-core',
58+
]
5559
babel.traverse(ast, {
5660
Program: {
5761
enter(programPath) {
5862
programPath.traverse({
5963
ImportDeclaration: (path) => {
60-
if (path.node.source.value !== `@tanstack/${framework}-start`) {
64+
if (!validImportSources.includes(path.node.source.value)) {
6165
return
6266
}
6367

0 commit comments

Comments
 (0)