diff --git a/apps/designer/.env.development b/apps/designer/.env.development index bb4a0c8..1e39543 100644 --- a/apps/designer/.env.development +++ b/apps/designer/.env.development @@ -1,5 +1,5 @@ # 只在开发模式中被载入 -ENV = 'development' +VITE_NODE_ENV = 'development' # 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path VITE_BASE_URL = / diff --git a/apps/designer/.env.production b/apps/designer/.env.production index fdb49f4..aa264ed 100644 --- a/apps/designer/.env.production +++ b/apps/designer/.env.production @@ -1,5 +1,5 @@ # 只在生产模式中被载入 -ENV = 'production' +VITE_NODE_ENV = 'production' # 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path VITE_BASE_URL = / diff --git a/apps/designer/.env.staging b/apps/designer/.env.staging index 7582267..81b616a 100644 --- a/apps/designer/.env.staging +++ b/apps/designer/.env.staging @@ -1,5 +1,5 @@ # 只在预发布模式中被载入 -ENV = 'staging' +VITE_NODE_ENV = 'staging' # 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path VITE_BASE_URL = / diff --git a/apps/designer/vite.config.ts b/apps/designer/vite.config.ts index 16f9a3e..568e616 100644 --- a/apps/designer/vite.config.ts +++ b/apps/designer/vite.config.ts @@ -46,10 +46,10 @@ export default defineConfig(({ mode }) => { define: { // 注入环境变量到客户端 __APP_ENV__: JSON.stringify(env) - }, - build: { - outDir: path.resolve(process.cwd(), '../../dist/designer'), // 输出到根目录/designer - emptyOutDir: true // 构建前清空目录 } + // build: { + // outDir: path.resolve(process.cwd(), '../../dist/designer'), + // emptyOutDir: true // 构建前清空目录 + // } }; }); diff --git a/apps/platform/.env.development b/apps/platform/.env.development index 2ce3ad5..6f48a5a 100644 --- a/apps/platform/.env.development +++ b/apps/platform/.env.development @@ -1,5 +1,5 @@ # 只在开发模式中被载入 -ENV = 'development' +VITE_NODE_ENV = 'development' # 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path VITE_BASE_URL = / diff --git a/apps/platform/.env.production b/apps/platform/.env.production index fdb49f4..aa264ed 100644 --- a/apps/platform/.env.production +++ b/apps/platform/.env.production @@ -1,5 +1,5 @@ # 只在生产模式中被载入 -ENV = 'production' +VITE_NODE_ENV = 'production' # 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path VITE_BASE_URL = / diff --git a/apps/platform/.env.staging b/apps/platform/.env.staging index 7582267..81b616a 100644 --- a/apps/platform/.env.staging +++ b/apps/platform/.env.staging @@ -1,5 +1,5 @@ # 只在预发布模式中被载入 -ENV = 'staging' +VITE_NODE_ENV = 'staging' # 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path VITE_BASE_URL = / diff --git a/apps/platform/vite.config.ts b/apps/platform/vite.config.ts index 0ab050f..69f87d8 100644 --- a/apps/platform/vite.config.ts +++ b/apps/platform/vite.config.ts @@ -24,6 +24,7 @@ const __APP_INFO__ = { // https://vitejs.dev/config/ export default ({ command, mode }: ConfigEnv): UserConfig => { + console.log('mode', mode); // 环境变量 const env = loadEnv(mode, process.cwd(), ['VITE_', 'VTJ_', 'SY_']); const isDev = command === 'serve'; @@ -119,7 +120,7 @@ export default ({ command, mode }: ConfigEnv): UserConfig => { }, }, build: { - outDir: resolve(process.cwd(), '../../dist/platform'), // 输出到根目录/designer + // outDir: resolve(process.cwd(), '../../dist/platform'), // 输出到根目录/designer emptyOutDir: true, terserOptions: { compress: { diff --git a/apps/renderer/.env.development b/apps/renderer/.env.development index 2ce3ad5..6f48a5a 100644 --- a/apps/renderer/.env.development +++ b/apps/renderer/.env.development @@ -1,5 +1,5 @@ # 只在开发模式中被载入 -ENV = 'development' +VITE_NODE_ENV = 'development' # 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path VITE_BASE_URL = / diff --git a/apps/renderer/.env.production b/apps/renderer/.env.production index fdb49f4..aa264ed 100644 --- a/apps/renderer/.env.production +++ b/apps/renderer/.env.production @@ -1,5 +1,5 @@ # 只在生产模式中被载入 -ENV = 'production' +VITE_NODE_ENV = 'production' # 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path VITE_BASE_URL = / diff --git a/apps/renderer/.env.staging b/apps/renderer/.env.staging index 7582267..81b616a 100644 --- a/apps/renderer/.env.staging +++ b/apps/renderer/.env.staging @@ -1,5 +1,5 @@ # 只在预发布模式中被载入 -ENV = 'staging' +VITE_NODE_ENV = 'staging' # 公共基础路径, 详见: https://cn.vitejs.dev/guide/build.html#public-base-path VITE_BASE_URL = / diff --git a/apps/renderer/farm.config.ts b/apps/renderer/farm.config.ts index 883a3db..348adfe 100644 --- a/apps/renderer/farm.config.ts +++ b/apps/renderer/farm.config.ts @@ -6,6 +6,7 @@ import path from "path"; // @ts-ignore export default defineConfig(({ mode }) => { + console.log("mode", mode); const env = loadEnv(mode, process.cwd(), ["VITE_"]); return { @@ -26,10 +27,10 @@ export default defineConfig(({ mode }) => { // 注入环境变量到客户端 "process.env": JSON.stringify(env), }, - output: { - path: path.resolve(process.cwd(), "../../dist/renderer"), - clean: true, - }, + // output: { + // path: path.resolve(process.cwd(), "../../dist/renderer"), + // clean: true, + // }, }, }; }); diff --git a/apps/y-code-v1/farm.config.ts b/apps/y-code-v1/farm.config.ts index 6115e9d..23e3b88 100644 --- a/apps/y-code-v1/farm.config.ts +++ b/apps/y-code-v1/farm.config.ts @@ -9,6 +9,7 @@ import { AntDesignVueResolver } from "unplugin-vue-components/resolvers"; // @ts-ignore export default defineConfig(({ mode }) => { + console.log("mode", mode); const env = loadEnv(mode, process.cwd(), ["VITE_"]); return { plugins: [less()], @@ -37,10 +38,10 @@ export default defineConfig(({ mode }) => { "@": path.resolve(__dirname, "./src"), }, }, - output: { - path: path.resolve(process.cwd(), "../../dist/y-code-v1"), - clean: true, - }, + // output: { + // path: path.resolve(process.cwd(), "../../dist/y-code-v1"), + // clean: true, + // }, }, }; }); diff --git a/turbo.json b/turbo.json index 40b68fc..8dfd00d 100644 --- a/turbo.json +++ b/turbo.json @@ -60,7 +60,11 @@ "inputs": [ "$TURBO_DEFAULT$" ], - "outputs": [] + "outputs": [ + "dist/**", + "types/**", + "*.d.ts" + ] } } } \ No newline at end of file