1 Star 0 Fork 1

江夏尧/游戏算法库文档

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.ts 1.40 KB
一键复制 编辑 原始数据 按行查看 历史
江夏尧 提交于 2022-02-26 16:23 . feat: 添加按需导入
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",
},
},
},
},
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/dongzhongzhidong/game-algorithm-docs.git
[email protected]:dongzhongzhidong/game-algorithm-docs.git
dongzhongzhidong
game-algorithm-docs
游戏算法库文档
master

搜索帮助