build: add exports field to support Node native ESM

This commit is contained in:
Evan You 2021-09-24 15:20:57 -04:00
parent f5076eb4b7
commit 570c955b48
2 changed files with 20 additions and 0 deletions

1
packages/vue/index.mjs Normal file
View File

@ -0,0 +1 @@
export * from './index.js'

View File

@ -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": [