wails-template-vue/frontend/packages/javascript/vite.config.js

38 lines
793 B
JavaScript
Raw Normal View History

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
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({
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: {
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
},
});