1 Star 0 Fork 31

PHP-Daemon/ok-admin-vue

forked from 无敌波/ok-admin-vue 
Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
文件
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
vite.config.ts 1.08 KB
Copy Edit Raw Blame History
zhizou authored 2021-07-15 23:10 . :wrench:NODE_ENV=production 环境配置
import type { UserConfig, ConfigEnv } from 'vite';
import { loadEnv, defineConfig } from 'vite';
import vue from '@vitejs/plugin-vue';
import vueJsx from '@vitejs/plugin-vue-jsx';
import path from 'path';
// https://cn.vitejs.dev/config/#build-assetsdir
// https://vitejs.dev/config/
// https://www.vitejs.net/guide/build.html#公共基础路径
// Dotenv 是一个零依赖的模块,它能将环境变量中的变量从 .env 文件加载到 process.env 中
// const dotenv = require("dotenv")
export default defineConfig(({ command, mode }: ConfigEnv): UserConfig => {
const root = process.cwd();
const env = loadEnv(mode, root);
console.log('env: ', env);
console.log('mode: ', mode);
console.log('command: ', command);
return {
plugins: [vue(), vueJsx()],
base: env['VITE_PUBLIC_PATH'] || '/',
build: {
outDir: env['VITE_OUT_DIR'] || 'dist'
},
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),
comps: path.resolve(__dirname, 'src/components')
}
},
server: {
port: 3000,
host: '0.0.0.0'
}
};
});
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/PHP-Daemon/ok-admin-vue.git
git@gitee.com:PHP-Daemon/ok-admin-vue.git
PHP-Daemon
ok-admin-vue
ok-admin-vue
master

Search

0d507c66 1850385 C8b1a773 1850385