vite.config.ts 646 B

1234567891011121314151617181920212223242526272829303132
  1. import { sveltekit } from '@sveltejs/kit/vite';
  2. import { defineConfig } from 'vite';
  3. import { viteStaticCopy } from 'vite-plugin-static-copy';
  4. export default defineConfig({
  5. plugins: [
  6. sveltekit(),
  7. viteStaticCopy({
  8. targets: [
  9. {
  10. src: 'node_modules/onnxruntime-web/dist/*.jsep.*',
  11. dest: 'wasm'
  12. }
  13. ]
  14. })
  15. ],
  16. define: {
  17. APP_VERSION: JSON.stringify(process.env.npm_package_version),
  18. APP_BUILD_HASH: JSON.stringify(process.env.APP_BUILD_HASH || 'dev-build')
  19. },
  20. build: {
  21. sourcemap: true
  22. },
  23. worker: {
  24. format: 'es'
  25. },
  26. esbuild: {
  27. pure: process.env.ENV === 'dev' ? [] : ['console.log', 'console.debug']
  28. }
  29. });