From 570c955b4896db2e0deb46d3eb30bbc9eba7747b Mon Sep 17 00:00:00 2001 From: Evan You Date: Fri, 24 Sep 2021 15:20:57 -0400 Subject: [PATCH] build: add exports field to support Node native ESM --- packages/vue/index.mjs | 1 + packages/vue/package.json | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 packages/vue/index.mjs diff --git a/packages/vue/index.mjs b/packages/vue/index.mjs new file mode 100644 index 00000000..8b436124 --- /dev/null +++ b/packages/vue/index.mjs @@ -0,0 +1 @@ +export * from './index.js' \ No newline at end of file diff --git a/packages/vue/package.json b/packages/vue/package.json index 2062b0c5..e2b14322 100644 --- a/packages/vue/package.json +++ b/packages/vue/package.json @@ -14,6 +14,25 @@ "server-renderer", "ref-macros.d.ts" ], + "exports": { + ".": { + "import": { + "node": "./index.mjs", + "default": "./dist/vue.runtime.esm-bundler.js" + }, + "require": "./index.js" + }, + "./server-renderer": { + "import": "./server-renderer/index.mjs", + "require": "./server-renderer/index.js" + }, + "./compiler-sfc": { + "import": "./compiler-sfc/index.mjs", + "require": "./compiler-sfc/index.js" + }, + "./dist/*": "./dist/*", + "./package.json": "./package.json" + }, "buildOptions": { "name": "Vue", "formats": [