Files
splatoon3.ink/vite.config.mjs
TenviLi 968d0033c2 chore(deps): upgrade Vite 7 to 8 and related toolchain
Dependency bumps:
- vite: 7.3.1 -> 8.2.2 (Rolldown + Oxc replace esbuild + Rollup)
- vitest: 4.0.18 -> 4.1.11
- @vitejs/plugin-vue: 6.0.4 -> 6.0.8
- @tailwindcss/vite & tailwindcss: 4.1.18 -> 4.3.3
- @intlify/unplugin-vue-i18n: 11.0.3 -> 11.2.5 (moved to devDependencies)
- vue: 3.5.28 -> 3.5.42
- vue-i18n: 11.2.8 -> 11.4.10

Config migration for Vite 8:
- Move the multi-page entry points to the top-level `input` option,
  replacing the deprecated `build.rollupOptions.input`
- Replace `__dirname` with `import.meta.dirname` for compatibility with
  Vite's upcoming native config loader
2026-08-31 02:35:13 +08:00

48 lines
1.1 KiB
JavaScript

import { resolve } from 'path';
import { fileURLToPath, URL } from 'url';
import { defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import tailwindcss from '@tailwindcss/vite';
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite';
const redirectToDist = [
'/assets/splatnet/',
'/data/',
];
// https://vitejs.dev/config/
export default defineConfig({
input: {
main: resolve(import.meta.dirname, 'index.html'),
screenshots: resolve(import.meta.dirname, 'screenshots/index.html'),
},
plugins: [
vue(),
tailwindcss(),
VueI18nPlugin({
include: resolve(import.meta.dirname, './src/assets/i18n/*.json'),
}),
{
// Quick hack to redirect dynamic assets to the /dist/ directory
configureServer(server) {
server.middlewares.use((req, res, next) => {
if (redirectToDist.some(s => req.url.startsWith(s))) {
req.url = '/dist' + req.url;
}
next();
});
},
},
],
resolve: {
alias: {
'@': fileURLToPath(new URL('./src', import.meta.url)),
},
},
build: {
emptyOutDir: false,
},
});