mirror of
https://github.com/bolucat/Archive.git
synced 2026-04-23 00:17:16 +08:00
34 lines
788 B
JavaScript
34 lines
788 B
JavaScript
import { defineConfig } from "vite";
|
|
import vue from "@vitejs/plugin-vue2";
|
|
import vueJsx from "@vitejs/plugin-vue2-jsx";
|
|
import path from "path";
|
|
|
|
export default defineConfig(({ mode }) => ({
|
|
plugins: [
|
|
vue(),
|
|
vueJsx({
|
|
include: [/\.[jt]sx$/, /\.js$/],
|
|
}),
|
|
],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(__dirname, "src"),
|
|
vue$: "vue/dist/vue.esm.js",
|
|
},
|
|
extensions: [".mjs", ".js", ".ts", ".jsx", ".tsx", ".json", ".vue"],
|
|
},
|
|
define: {
|
|
apiRoot: '`${localStorage["backendAddress"]}/api`',
|
|
},
|
|
server: {
|
|
port: 8081,
|
|
},
|
|
build: {
|
|
outDir: process.env.OUTPUT_DIR || "../web",
|
|
sourcemap: false,
|
|
assetsDir: "static",
|
|
emptyOutDir: true,
|
|
},
|
|
base: process.env.publicPath || (mode === "production" ? "./" : "/"),
|
|
}));
|