Skip to content

Commit

Permalink
fix(build): fix mjs dual package hazard
Browse files Browse the repository at this point in the history
close #12626
  • Loading branch information
yyx990803 committed Jul 8, 2022
1 parent 559600f commit 012e10c
Show file tree
Hide file tree
Showing 3 changed files with 79 additions and 7 deletions.
75 changes: 75 additions & 0 deletions dist/vue.runtime.mjs
@@ -0,0 +1,75 @@
import Vue from './vue.runtime.common.js'
export default Vue

// this should be kept in sync with src/v3/index.ts
export const {
version,

// refs
ref,
shallowRef,
isRef,
toRef,
toRefs,
unref,
proxyRefs,
customRef,
triggerRef,
computed,

// reactive
reactive,
isReactive,
isReadonly,
isShallow,
isProxy,
shallowReactive,
markRaw,
toRaw,
readonly,
shallowReadonly,

// watch
watch,
watchEffect,
watchPostEffect,
watchSyncEffect,

// effectScope
effectScope,
onScopeDispose,
getCurrentScope,

// provide / inject
provide,
inject,

// lifecycle
onBeforeMount,
onMounted,
onBeforeUpdate,
onUpdated,
onUnmounted,

This comment has been minimized.

Copy link
@sebamarynissen

sebamarynissen Jul 8, 2022

@yyx990803 Looks like you forgot onBeforeUnmount here.

onErrorCaptured,
onActivated,
onDeactivated,
onServerPrefetch,
onRenderTracked,
onRenderTriggered,

// v2 only
set,
del,

// v3 compat
h,
getCurrentInstance,
useSlots,
useAttrs,
mergeDefaults,
nextTick,
useCssModule,
useCssVars,
defineComponent,
defineAsyncComponent
} = Vue
7 changes: 0 additions & 7 deletions scripts/config.js
Expand Up @@ -71,13 +71,6 @@ 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'),
Expand Down
4 changes: 4 additions & 0 deletions src/v3/index.ts
@@ -1,3 +1,7 @@
/**
* Note: also update dist/vue.runtime.mjs when adding new exports to this file.
*/

export const version: string = '__VERSION__'

export {
Expand Down

0 comments on commit 012e10c

Please sign in to comment.