chore: 框架构建流程调整
This commit is contained in:
@@ -7,13 +7,16 @@ import mkcert from 'vite-plugin-mkcert';
|
||||
// @ts-ignore
|
||||
export default defineConfig(({ mode }) => {
|
||||
console.log('mode', mode);
|
||||
const env = loadEnv(mode, process.cwd(), ['VITE_', 'Y_CODE_']);
|
||||
const env = loadEnv(mode, process.cwd(), ['VITE_']);
|
||||
const isDev = env.VITE_NODE_ENV === 'development';
|
||||
|
||||
return {
|
||||
server: {
|
||||
port: Number(env.VITE_PORT),
|
||||
cors: true,
|
||||
},
|
||||
server: isDev
|
||||
? {
|
||||
port: Number(env.VITE_PORT),
|
||||
cors: true,
|
||||
}
|
||||
: undefined,
|
||||
// @ts-ignore coding
|
||||
vitePlugins: [vue(), mkcert({ source: 'coding' })],
|
||||
compilation: {
|
||||
|
||||
Reference in New Issue
Block a user