1 Star 0 Fork 290

朱建波/threejs 3d模型可视化编辑器

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
vite.config.js 1.37 KB
一键复制 编辑 原始数据 按行查看 历史
答案 提交于 2024-06-03 22:55 . docs:修改文档
import { defineConfig, loadEnv } from 'vite'
import vue from '@vitejs/plugin-vue'
import vueJsx from "@vitejs/plugin-vue-jsx";
import { resolve } from "path";
export default defineConfig((mode) => {
const { VITE_USER_NODE_ENV } = loadEnv(mode.mode, process.cwd());
const base = VITE_USER_NODE_ENV == 'production' ? '/three.js3d/' : '/'
return {
plugins: [vue(), vueJsx()],
resolve: {
alias: {
"@": resolve(__dirname, "src"),
'vue': 'vue/dist/vue.esm-bundler.js'
}
},
assetsInclude: ['**/*.hdr', '**/*.glb'],
esbuild: { loader: { '.js': '.jsx' } },
base,
server: {
host: '0.0.0.0',
open: true,
port: 9999
},
build: {
assetsDir: 'static',
emptyOutDir: true,
minify: 'esbuild',
rollupOptions: {
input: {
index: resolve(__dirname, 'index.html'),
preview: resolve(__dirname, 'preview.html'),
},
output: {
compact: true,
entryFileNames: "static/js/[name]-[hash].js",
chunkFileNames: "static/js/[name]-[hash].js",
assetFileNames: "static/[ext]/[name].[ext]",
}
},
},
}
})
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/zhu-jian-bo/Three.js3D.git
git@gitee.com:zhu-jian-bo/Three.js3D.git
zhu-jian-bo
Three.js3D
threejs 3d模型可视化编辑器
master

搜索帮助