mirror of https://github.com/vuejs/vue.git
feat: add exports field + mjs build
This commit is contained in:
parent
5673363eda
commit
d3172377e0
|
@ -0,0 +1 @@
|
||||||
|
export * from '@vue/compiler-sfc'
|
|
@ -1,4 +1,5 @@
|
||||||
{
|
{
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
|
"module": "index.mjs",
|
||||||
"types": "index.d.ts"
|
"types": "index.d.ts"
|
||||||
}
|
}
|
||||||
|
|
16
package.json
16
package.json
|
@ -15,6 +15,22 @@
|
||||||
"compiler-sfc",
|
"compiler-sfc",
|
||||||
"packages/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,
|
"sideEffects": false,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "rollup -w -c scripts/config.js --environment TARGET:full-dev",
|
"dev": "rollup -w -c scripts/config.js --environment TARGET:full-dev",
|
||||||
|
|
|
@ -65,6 +65,13 @@ const builds = {
|
||||||
format: 'es',
|
format: 'es',
|
||||||
banner
|
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)
|
// Runtime+compiler ES modules build (for bundlers)
|
||||||
'full-esm': {
|
'full-esm': {
|
||||||
entry: resolve('web/entry-runtime-with-compiler-esm.ts'),
|
entry: resolve('web/entry-runtime-with-compiler-esm.ts'),
|
||||||
|
|
Loading…
Reference in New Issue