| 141 | enforce: 'post', |
| 142 | apply: 'serve', |
| 143 | config(userConfig) { |
| 144 | const od = (userConfig as any)?.optimizeDeps || {}; |
| 145 | const prevExclude: string[] = Array.isArray(od.exclude) ? od.exclude : []; |
| 146 | const exclude = new Set<string>(prevExclude); |
| 147 | ['@nativescript/core', 'rxjs', '@valor/nativescript-websockets', 'set-value', 'react', 'react-reconciler', 'react-nativescript'].forEach((x) => exclude.add(x)); |
| 148 | return { |
| 149 | optimizeDeps: { |
| 150 | noDiscovery: true, |
| 151 | entries: [], |
| 152 | include: [], |
| 153 | exclude: Array.from(exclude), |
| 154 | esbuildOptions: { |
| 155 | ...(od.esbuildOptions || {}), |
| 156 | plugins: [], |
| 157 | }, |
| 158 | }, |
| 159 | } as any; |
| 160 | }, |
| 161 | configResolved(resolved) { |
| 162 | const deps = (resolved.optimizeDeps ||= {} as any); |
| 163 | deps.noDiscovery = true; |