blessing-skin-server/vite.config.ts
Zephyr Lykos 00639b7bc2
cleanup: wip 5
Use admin-lte@next, @angular-package/spectre.css
2024-03-05 11:20:32 +08:00

44 lines
1.2 KiB
TypeScript

import {defineConfig, splitVendorChunkPlugin} from 'vite';
import laravel from 'laravel-vite-plugin';
import react from '@vitejs/plugin-react-swc';
import wasm from 'vite-plugin-wasm';
import topLevelAwait from 'vite-plugin-top-level-await';
import browserslistToEsbuild from 'browserslist-to-esbuild';
const root = new URL('resources/assets/src/', import.meta.url);
export default defineConfig({
plugins: [
laravel([
new URL('index.tsx', root).pathname,
new URL('scripts/homePage.ts', root).pathname,
new URL('app.css', root).pathname,
new URL('spectre.css', root).pathname,
new URL('home.css', root).pathname,
]),
react(),
wasm(),
topLevelAwait(),
splitVendorChunkPlugin(),
],
resolve: {
alias: {
'@/': root.pathname,
readline: new URL('scripts/cli/readline.ts', root).pathname,
'~bootstrap': new URL('node_modules/admin-lte/node_modules/bootstrap', import.meta.url).pathname,
'spectre.css': new URL('node_modules/spectre.css', import.meta.url).pathname,
},
},
publicDir: false,
build: {
target: browserslistToEsbuild(),
sourcemap: true,
copyPublicDir: false,
rollupOptions: {
treeshake: {
preset: 'recommended',
},
},
},
});