11import { resolve } from 'node:path'
2+ import {
3+ CONFIG_FILE ,
4+ createDefaultEnvironment ,
5+ createSerializedOptionsFromPersisted ,
6+ readConfigFile ,
7+ writeConfigFileToEnvironment ,
8+ } from '@tanstack/cta-engine'
9+
210import { TMP_TARGET_DIR } from '../constants'
311import { cleanUpFileArray , cleanUpFiles } from './file-helpers'
412import { getProjectPath } from './server-environment'
@@ -17,17 +25,9 @@ export async function addToAppWrapper(
1725 environmentFactory ?: ( ) => any
1826 }
1927) {
20- // Dynamically import CTA engine to prevent client bundling
21- const {
22- CONFIG_FILE ,
23- addToApp,
24- createAppOptionsFromPersisted,
25- createDefaultEnvironment,
26- createSerializedOptionsFromPersisted,
27- readConfigFile,
28- recursivelyGatherFiles,
29- writeConfigFileToEnvironment,
30- } = await import ( '@tanstack/cta-engine' )
28+ // Dynamically import only the heavy file operation stuff
29+ const { addToApp, createAppOptionsFromPersisted, recursivelyGatherFiles } =
30+ await import ( '@tanstack/cta-engine' )
3131
3232 const projectPath = getProjectPath ( )
3333
0 commit comments