代码拉取完成,页面将自动刷新
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import fastExternal from "vite-plugin-fast-external";
import { visualizer } from "rollup-plugin-visualizer";
const paths = {
"pixi.js": "https://cdn.skypack.dev/pixi.js",
animejs: "https://cdn.skypack.dev/animejs",
"game-algorithm":
"https://cdn.jsdelivr.net/npm/game-algorithm/dist/index.min.js",
"game-random": "https://cdn.jsdelivr.net/npm/game-random/dist/index.min.js",
"enum-color": "https://cdn.jsdelivr.net/npm/enum-color",
};
const specialPath: { [key: string]: () => string } = {};
// https://vitejs.dev/config/
export default defineConfig({
plugins: [
vue(),
fastExternal(
Object.entries(paths).reduce((col, [moduleName, url]) => {
col[moduleName] = () => `export * from "${url}"`;
return col;
}, specialPath)
),
],
resolve: {
alias: {
"@": "src", // 设置 `@` 指向 `src` 目录
"@@": "packages", // 设置 `@` 指向 `src` 目录
},
},
base: "./", // 设置打包路径
build: {
rollupOptions: {
plugins: [visualizer({ filename: "./dist/stat.html" }) as any],
output: {
globals: {
vue: "Vue",
"vue-router": "VueRouter",
},
},
},
},
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。