2021-11-15 03:07:00 +08:00
|
|
|
import { defineConfig } from "vite";
|
|
|
|
import vue from "@vitejs/plugin-vue";
|
|
|
|
import path from "path";
|
2021-11-03 01:53:20 +08:00
|
|
|
|
2022-03-23 21:46:26 +08:00
|
|
|
import pkg from "../../package.json";
|
|
|
|
import { createHtmlPlugin } from "vite-plugin-html";
|
2021-11-03 01:53:20 +08:00
|
|
|
// https://vitejs.dev/config/
|
|
|
|
export default defineConfig({
|
2022-03-23 21:46:26 +08:00
|
|
|
plugins: [
|
|
|
|
vue(),
|
|
|
|
createHtmlPlugin({
|
|
|
|
minify: false,
|
|
|
|
// entry: "src/main.js",
|
|
|
|
template: "index.html",
|
|
|
|
inject: {
|
|
|
|
data: {
|
|
|
|
title: `${pkg.name}`,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}),
|
|
|
|
],
|
2021-11-03 01:53:20 +08:00
|
|
|
resolve: {
|
|
|
|
alias: {
|
2021-11-15 03:07:00 +08:00
|
|
|
"@": path.resolve(__dirname, "src"),
|
2021-11-03 01:53:20 +08:00
|
|
|
},
|
|
|
|
},
|
|
|
|
build: {
|
2022-03-23 21:46:26 +08:00
|
|
|
outDir: "../../dist",
|
2021-11-03 01:53:20 +08:00
|
|
|
rollupOptions: {
|
|
|
|
output: {
|
|
|
|
entryFileNames: `assets/[name].js`,
|
|
|
|
chunkFileNames: `assets/[name].js`,
|
|
|
|
assetFileNames: `assets/[name].[ext]`,
|
2021-11-15 03:07:00 +08:00
|
|
|
},
|
2021-11-03 01:53:20 +08:00
|
|
|
},
|
2021-11-15 03:07:00 +08:00
|
|
|
},
|
|
|
|
});
|