nuxt.config.ts 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. import tailwindcss from '@tailwindcss/vite'
  2. import svgLoader from 'vite-svg-loader'
  3. // https://nuxt.com/docs/api/configuration/nuxt-config
  4. export default defineNuxtConfig({
  5. modules: [
  6. '@nuxt/eslint',
  7. '@vant/nuxt',
  8. '@pinia/nuxt',
  9. '@nuxt/fonts',
  10. '@nuxt/image',
  11. '@nuxtjs/i18n',
  12. '@vueuse/nuxt',
  13. '@sentry/nuxt/module',
  14. ],
  15. devtools: { enabled: true },
  16. css: ['~/assets/css/main.css'],
  17. runtimeConfig: {
  18. public: {
  19. env: process.env.NUXT_PUBLIC_ENV,
  20. apiBase: process.env.NUXT_PUBLIC_API_BASE,
  21. apiIdentity: process.env.NUXT_PUBLIC_API_IDENTITY,
  22. googleClientId: process.env.NUXT_PUBLIC_GOOGLE_CLIENT_ID,
  23. imAppId: process.env.NUXT_PUBLIC_IM_APPID,
  24. },
  25. serverApiBase: process.env.NUXT_SERVER_API_BASE,
  26. serverImSecret: process.env.NUXT_SERVER_IM_SECRET,
  27. },
  28. sourcemap: {
  29. client: 'hidden',
  30. },
  31. compatibilityDate: '2025-07-15',
  32. vite: {
  33. plugins: [
  34. tailwindcss(),
  35. svgLoader({
  36. svgoConfig: {
  37. multipass: true,
  38. plugins: [
  39. {
  40. name: 'preset-default',
  41. params: {
  42. overrides: {
  43. removeViewBox: false,
  44. },
  45. },
  46. },
  47. ],
  48. },
  49. }),
  50. ],
  51. css: {
  52. preprocessorOptions: {
  53. scss: {
  54. additionalData: `
  55. @use "~/assets/css/mixins.scss" as *;
  56. `,
  57. },
  58. },
  59. },
  60. },
  61. debug: false,
  62. eslint: {
  63. config: {
  64. stylistic: true,
  65. },
  66. },
  67. fonts: {
  68. defaults: {
  69. weights: ['400 600'],
  70. },
  71. },
  72. i18n: {
  73. defaultLocale: 'en',
  74. strategy: 'no_prefix',
  75. langDir: 'locales',
  76. locales: [
  77. { code: 'en', name: 'English', file: 'en.json' },
  78. { code: 'id', name: 'Bahasa Indonesia', file: 'id.json' },
  79. { code: 'zh', name: '简体中文', file: 'zh.json' },
  80. ],
  81. },
  82. sentry: {
  83. enabled: process.env.NUXT_PUBLIC_ENV === 'production',
  84. org: 'gamivip',
  85. project: 'javascript-nuxt',
  86. autoInjectServerSentry: 'top-level-import',
  87. },
  88. })