Files
bestpc/vite.config.ts

30 lines
778 B
TypeScript
Raw Permalink Normal View History

2025-04-29 11:36:07 +07:00
import { defineConfig } from 'vite';
import preact from '@preact/preset-vite';
2025-05-28 15:30:26 +07:00
import path from 'path';
2025-04-29 11:36:07 +07:00
2025-05-07 16:03:56 +07:00
2025-04-29 11:36:07 +07:00
// https://vitejs.dev/config/
export default defineConfig({
plugins: [preact()],
server: {
watch: {
// Thêm thư mục ngoài src mà bạn muốn theo dõi
usePolling: true, // Dùng polling để theo dõi thay đổi
ignored: ['!**/node_modules/**'], // Loại bỏ các thư mục không cần theo dõi
}
},
2025-05-28 15:30:26 +07:00
base: '/assets/', // base public path
build: {
outDir: 'public_html/assets/builder', // build vào đúng thư mục bạn cần
emptyOutDir: true,
rollupOptions: {
input: path.resolve(__dirname, 'src/index.tsx'),
output: {
entryFileNames: 'index.js',
assetFileNames: 'style.css',
}
}
},
2025-05-07 16:03:56 +07:00
publicDir: 'static',
2025-04-29 11:36:07 +07:00
});