1 Star 0 Fork 719

trover/datav-vue

forked from pengxiaotian/datav-vue 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
vite.config.ts 1.87 KB
一键复制 编辑 原始数据 按行查看 历史
pengxiaotian 提交于 2022-12-10 21:23 . feat: 创建china2d组件 (#59)
import type { ConfigEnv } from 'vite'
import { loadEnv, defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import ElementPlus from 'unplugin-element-plus/vite'
import plainText from 'vite-plugin-plain-text'
import { resolve } from 'path'
function pathResolve(dir: string) {
return resolve(process.cwd(), '.', dir)
}
// https://vitejs.dev/config/
export default ({ mode }: ConfigEnv) => {
const dirRoot = process.cwd()
const env = loadEnv(mode, dirRoot)
return defineConfig({
base: env.VITE_PUBLIC_PATH,
plugins: [
vue(),
ElementPlus(),
plainText(/\.hbs$/),
],
server: {
host: '0.0.0.0',
port: 9096,
},
resolve: {
alias: {
'@': pathResolve('./src'),
'vue-i18n': pathResolve('./node_modules/vue-i18n/dist/vue-i18n.cjs.js'),
},
},
define: {
// setting vue-i18-next
// Suppress warning
__INTLIFY_PROD_DEVTOOLS__: false,
__DEV__: process.env.NODE_ENV !== 'production',
__PROD__: process.env.NODE_ENV === 'production',
},
optimizeDeps: {
include: [
'@monaco-editor/loader',
'accounting',
'axios',
'axios-mock-adapter',
'crypto-js',
'dayjs',
'echarts',
'echarts-wordcloud',
'element-plus',
'gsap',
'html2canvas',
'js-cookie',
'lodash-es',
'mockjs',
'monaco-editor',
'naive-ui',
'number-precision',
'particles.vue3',
'shortid',
'vue',
'vue-echarts',
'vue-i18n',
'vue-router',
],
exclude: [],
},
build: {
sourcemap: false,
outDir: 'website',
rollupOptions: {
input: {
main: resolve(__dirname, 'index.html'),
share: resolve(__dirname, 'index.share.html'),
},
},
},
esbuild: {
},
})
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
TypeScript
1
https://gitee.com/trover/datav-vue.git
git@gitee.com:trover/datav-vue.git
trover
datav-vue
datav-vue
main

搜索帮助