haimian_landing/vite.config.js

39 lines
780 B
JavaScript
Raw Permalink Normal View History

2024-07-03 14:42:48 +08:00
import { defineConfig } from "vite";
import { resolve } from "path";
import copy from "rollup-plugin-copy";
export default defineConfig({
base: "./",
plugins: [
// copy({
// verbose: true,
// hook: "closeBundle",
// targets: [{ src: "readme.md", dest: "dist", rename: "readme.md" }],
// }),
],
terserOptions: {
compress: {
drop_console: true,
},
},
build: {
outDir: "dist",
emptyOutDir: true,
rollupOptions: {
input: {
main: resolve(__dirname, "index.html"),
},
output: {
entryFileNames: "[name].js",
chunkFileNames: "[name].js",
assetFileNames: `[name].[ext]`,
},
},
},
resolve: {
alias: {
"@": resolve(__dirname, "./src"),
},
},
});