mirror of
https://gitee.com/vuejs/vue.git
synced 2024-11-29 18:47:39 +08:00
feat: add exports field + mjs build
This commit is contained in:
parent
5673363eda
commit
d3172377e0
1
compiler-sfc/index.mjs
Normal file
1
compiler-sfc/index.mjs
Normal file
@ -0,0 +1 @@
|
||||
export * from '@vue/compiler-sfc'
|
@ -1,4 +1,5 @@
|
||||
{
|
||||
"main": "index.js",
|
||||
"module": "index.mjs",
|
||||
"types": "index.d.ts"
|
||||
}
|
||||
|
16
package.json
16
package.json
@ -15,6 +15,22 @@
|
||||
"compiler-sfc",
|
||||
"packages/compiler-sfc"
|
||||
],
|
||||
"exports": {
|
||||
".": {
|
||||
"import": {
|
||||
"node": "./dist/vue.runtime.mjs",
|
||||
"default": "./dist/vue.runtime.esm.js"
|
||||
},
|
||||
"require": "./dist/vue.runtime.common.js",
|
||||
"types": "./types/index.d.ts"
|
||||
},
|
||||
"./compiler-sfc": {
|
||||
"import": "./compiler-sfc/index.mjs",
|
||||
"require": "./compiler-sfc/index.js"
|
||||
},
|
||||
"./dist/*": "./dist/*",
|
||||
"./types/*": "./types/*"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"scripts": {
|
||||
"dev": "rollup -w -c scripts/config.js --environment TARGET:full-dev",
|
||||
|
@ -65,6 +65,13 @@ const builds = {
|
||||
format: 'es',
|
||||
banner
|
||||
},
|
||||
// Runtime only ES modules build (for Node)
|
||||
'runtime-mjs': {
|
||||
entry: resolve('web/entry-runtime-esm.ts'),
|
||||
dest: resolve('dist/vue.runtime.mjs'),
|
||||
format: 'es',
|
||||
banner
|
||||
},
|
||||
// Runtime+compiler ES modules build (for bundlers)
|
||||
'full-esm': {
|
||||
entry: resolve('web/entry-runtime-with-compiler-esm.ts'),
|
||||
|
Loading…
Reference in New Issue
Block a user