mirror of
https://github.com/coaidev/coai.git
synced 2025-05-23 23:10:13 +09:00
46 lines
923 B
TypeScript
46 lines
923 B
TypeScript
import { defineConfig } from 'vite'
|
|
import react from '@vitejs/plugin-react-swc'
|
|
import path from "path"
|
|
import { createHtmlPlugin } from 'vite-plugin-html'
|
|
import { viteExternalsPlugin } from 'vite-plugin-externals'
|
|
import terser from '@rollup/plugin-terser'
|
|
|
|
// https://vitejs.dev/config/
|
|
export default defineConfig({
|
|
plugins: [
|
|
react(),
|
|
createHtmlPlugin({
|
|
minify: true,
|
|
}),
|
|
viteExternalsPlugin(),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "./src"),
|
|
},
|
|
},
|
|
css: {
|
|
preprocessorOptions: {
|
|
less: {
|
|
javascriptEnabled: true,
|
|
}
|
|
}
|
|
},
|
|
build: {
|
|
manifest: true,
|
|
rollupOptions: {
|
|
output: {
|
|
entryFileNames: `assets/[name].[hash].js`,
|
|
chunkFileNames: `assets/[name].[hash].js`,
|
|
},
|
|
plugins: [
|
|
terser({
|
|
format: {
|
|
comments: false,
|
|
}
|
|
})
|
|
]
|
|
},
|
|
}
|
|
});
|