From 7010af28ffb8c6476c59bbf56098c8ad617cb763 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 3 Jan 2024 11:51:18 +0000 Subject: [PATCH] build: add production/development export conditions --- packages/compiler-core/package.json | 13 +++++++++++++ packages/compiler-dom/package.json | 13 +++++++++++++ packages/compiler-sfc/package.json | 9 +++++++++ packages/reactivity/package.json | 13 +++++++++++++ packages/runtime-core/package.json | 13 +++++++++++++ packages/runtime-dom/package.json | 13 +++++++++++++ packages/server-renderer/package.json | 13 +++++++++++++ packages/shared/package.json | 13 +++++++++++++ packages/vue-compat/package.json | 13 +++++++++++++ packages/vue/package.json | 6 +++++- 10 files changed, 118 insertions(+), 1 deletion(-) diff --git a/packages/compiler-core/package.json b/packages/compiler-core/package.json index 1c7692811c4..368fb59b705 100644 --- a/packages/compiler-core/package.json +++ b/packages/compiler-core/package.json @@ -9,6 +9,19 @@ "index.js", "dist" ], + "exports": { + ".": { + "types": "./dist/compiler-core.d.ts", + "node": { + "production": "./dist/compiler-core.cjs.prod.js", + "development": "./dist/compiler-core.cjs.js", + "default": "./index.js" + }, + "import": "./dist/compiler-core.esm-bundler.js", + "require": "./index.js" + }, + "./*": "./*" + }, "buildOptions": { "name": "VueCompilerCore", "compat": true, diff --git a/packages/compiler-dom/package.json b/packages/compiler-dom/package.json index 81904228feb..c8ee9accc43 100644 --- a/packages/compiler-dom/package.json +++ b/packages/compiler-dom/package.json @@ -11,6 +11,19 @@ "index.js", "dist" ], + "exports": { + ".": { + "types": "./dist/compiler-dom.d.ts", + "node": { + "production": "./dist/compiler-dom.cjs.prod.js", + "development": "./dist/compiler-dom.cjs.js", + "default": "./index.js" + }, + "import": "./dist/compiler-dom.esm-bundler.js", + "require": "./index.js" + }, + "./*": "./*" + }, "sideEffects": false, "buildOptions": { "name": "VueCompilerDOM", diff --git a/packages/compiler-sfc/package.json b/packages/compiler-sfc/package.json index ba1ec3ce6e3..b027aafe5af 100644 --- a/packages/compiler-sfc/package.json +++ b/packages/compiler-sfc/package.json @@ -8,6 +8,15 @@ "files": [ "dist" ], + "exports": { + ".": { + "types": "./dist/compiler-sfc.d.ts", + "node": "./dist/compiler-sfc.cjs.js", + "import": "./dist/compiler-sfc.esm-browser.js", + "require": "./dist/compiler-sfc.cjs.js" + }, + "./*": "./*" + }, "buildOptions": { "name": "VueCompilerSFC", "formats": [ diff --git a/packages/reactivity/package.json b/packages/reactivity/package.json index e42c4517a7e..fb2280e2acb 100644 --- a/packages/reactivity/package.json +++ b/packages/reactivity/package.json @@ -11,6 +11,19 @@ "index.js", "dist" ], + "exports": { + ".": { + "types": "./dist/reactivity.d.ts", + "node": { + "production": "./dist/reactivity.cjs.prod.js", + "development": "./dist/reactivity.cjs.js", + "default": "./index.js" + }, + "import": "./dist/reactivity.esm-bundler.js", + "require": "./index.js" + }, + "./*": "./*" + }, "sideEffects": false, "repository": { "type": "git", diff --git a/packages/runtime-core/package.json b/packages/runtime-core/package.json index 14981ebc616..f05022a0afb 100644 --- a/packages/runtime-core/package.json +++ b/packages/runtime-core/package.json @@ -9,6 +9,19 @@ "index.js", "dist" ], + "exports": { + ".": { + "types": "./dist/runtime-core.d.ts", + "node": { + "production": "./dist/runtime-core.cjs.prod.js", + "development": "./dist/runtime-core.cjs.js", + "default": "./index.js" + }, + "import": "./dist/runtime-core.esm-bundler.js", + "require": "./index.js" + }, + "./*": "./*" + }, "buildOptions": { "name": "VueRuntimeCore", "formats": [ diff --git a/packages/runtime-dom/package.json b/packages/runtime-dom/package.json index 71c3a7e5de0..4f28fccfba3 100644 --- a/packages/runtime-dom/package.json +++ b/packages/runtime-dom/package.json @@ -10,6 +10,19 @@ "index.js", "dist" ], + "exports": { + ".": { + "types": "./dist/runtime-dom.d.ts", + "node": { + "production": "./dist/runtime-dom.cjs.prod.js", + "development": "./dist/runtime-dom.cjs.js", + "default": "./index.js" + }, + "import": "./dist/runtime-dom.esm-bundler.js", + "require": "./index.js" + }, + "./*": "./*" + }, "sideEffects": false, "buildOptions": { "name": "VueRuntimeDOM", diff --git a/packages/server-renderer/package.json b/packages/server-renderer/package.json index 1c1ce915bee..00f15ee089f 100644 --- a/packages/server-renderer/package.json +++ b/packages/server-renderer/package.json @@ -9,6 +9,19 @@ "index.js", "dist" ], + "exports": { + ".": { + "types": "./dist/server-renderer.d.ts", + "node": { + "production": "./dist/server-renderer.cjs.prod.js", + "development": "./dist/server-renderer.cjs.js", + "default": "./index.js" + }, + "import": "./dist/server-renderer.esm-bundler.js", + "require": "./index.js" + }, + "./*": "./*" + }, "buildOptions": { "name": "VueServerRenderer", "formats": [ diff --git a/packages/shared/package.json b/packages/shared/package.json index 6c46a5841e1..3fb9ac65923 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -9,6 +9,19 @@ "index.js", "dist" ], + "exports": { + ".": { + "types": "./dist/shared.d.ts", + "node": { + "production": "./dist/shared.cjs.prod.js", + "development": "./dist/shared.cjs.js", + "default": "./index.js" + }, + "import": "./dist/shared.esm-bundler.js", + "require": "./index.js" + }, + "./*": "./*" + }, "sideEffects": false, "buildOptions": { "formats": [ diff --git a/packages/vue-compat/package.json b/packages/vue-compat/package.json index b40b0ccad68..8ba0c91a9df 100644 --- a/packages/vue-compat/package.json +++ b/packages/vue-compat/package.json @@ -10,6 +10,19 @@ "index.js", "dist" ], + "exports": { + ".": { + "types": "./dist/vue.d.ts", + "node": { + "production": "./dist/vue.cjs.prod.js", + "development": "./dist/vue.cjs.js", + "default": "./index.js" + }, + "import": "./dist/vue.esm-bundler.js", + "require": "./index.js" + }, + "./*": "./*" + }, "buildOptions": { "name": "Vue", "filename": "vue", diff --git a/packages/vue/package.json b/packages/vue/package.json index ca8d9b19608..887c6ddaa7e 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -20,7 +20,11 @@ ".": { "import": { "types": "./dist/vue.d.mts", - "node": "./index.mjs", + "node": { + "production": "./dist/vue.cjs.prod.js", + "development": "./dist/vue.cjs.js", + "default": "./index.mjs" + }, "default": "./dist/vue.runtime.esm-bundler.js" }, "require": {