| 
									
										
										
										
											2023-10-09 06:38:42 +08:00
										 |  |  | import { sveltekit } from '@sveltejs/kit/vite'; | 
					
						
							|  |  |  | import { defineConfig } from 'vite'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-08 18:34:30 +08:00
										 |  |  | import { viteStaticCopy } from 'vite-plugin-static-copy'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-09 06:38:42 +08:00
										 |  |  | export default defineConfig({ | 
					
						
							| 
									
										
										
										
											2025-02-08 18:34:30 +08:00
										 |  |  | 	plugins: [ | 
					
						
							|  |  |  | 		sveltekit(), | 
					
						
							|  |  |  | 		viteStaticCopy({ | 
					
						
							|  |  |  | 			targets: [ | 
					
						
							|  |  |  | 				{ | 
					
						
							|  |  |  | 					src: 'node_modules/onnxruntime-web/dist/*.jsep.*', | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 					dest: 'wasm' | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 			] | 
					
						
							|  |  |  | 		}) | 
					
						
							|  |  |  | 	], | 
					
						
							| 
									
										
										
										
											2024-02-22 09:10:27 +08:00
										 |  |  | 	define: { | 
					
						
							| 
									
										
										
										
											2024-05-23 03:22:38 +08:00
										 |  |  | 		APP_VERSION: JSON.stringify(process.env.npm_package_version), | 
					
						
							| 
									
										
										
										
											2024-05-26 15:49:30 +08:00
										 |  |  | 		APP_BUILD_HASH: JSON.stringify(process.env.APP_BUILD_HASH || 'dev-build') | 
					
						
							| 
									
										
										
										
											2024-05-18 14:30:42 +08:00
										 |  |  | 	}, | 
					
						
							| 
									
										
										
										
											2024-05-25 16:03:04 +08:00
										 |  |  | 	build: { | 
					
						
							| 
									
										
										
										
											2025-06-09 05:36:32 +08:00
										 |  |  | 		sourcemap: true | 
					
						
							| 
									
										
										
										
											2024-05-25 16:03:04 +08:00
										 |  |  | 	}, | 
					
						
							| 
									
										
										
										
											2024-05-18 14:30:42 +08:00
										 |  |  | 	worker: { | 
					
						
							|  |  |  | 		format: 'es' | 
					
						
							| 
									
										
										
										
											2025-06-13 18:42:09 +08:00
										 |  |  | 	}, | 
					
						
							|  |  |  | 	esbuild: { | 
					
						
							| 
									
										
										
										
											2025-09-09 18:03:47 +08:00
										 |  |  | 		pure: process.env.ENV === 'dev' ? [] : ['console.log', 'console.debug', 'console.error'] | 
					
						
							| 
									
										
										
										
											2025-06-13 19:54:15 +08:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2023-10-09 06:38:42 +08:00
										 |  |  | }); |