30 lines
778 B
TypeScript
30 lines
778 B
TypeScript
import { defineConfig } from 'vite';
|
|
import preact from '@preact/preset-vite';
|
|
import path from 'path';
|
|
|
|
|
|
// 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
|
|
}
|
|
},
|
|
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',
|
|
}
|
|
}
|
|
},
|
|
publicDir: 'static',
|
|
});
|