File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
packages/runtime-vapor/src Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change 1- import type { VaporComponent } from './component'
1+ import type { ObjectVaporComponent , VaporComponent } from './component'
2+ import { extend , isFunction } from '@vue/shared'
23
34/*! #__NO_SIDE_EFFECTS__ */
4- export function defineVaporComponent ( comp : VaporComponent ) : VaporComponent {
5+ export function defineVaporComponent (
6+ comp : VaporComponent ,
7+ extraOptions ?: Omit < ObjectVaporComponent , 'setup' > ,
8+ ) : VaporComponent {
9+ if ( isFunction ( comp ) ) {
10+ // #8236: extend call and options.name access are considered side-effects
11+ // by Rollup, so we have to wrap it in a pure-annotated IIFE.
12+ return /*@__PURE__ */ ( ( ) =>
13+ extend ( { name : comp . name } , extraOptions , {
14+ setup : comp ,
15+ } ) ) ( )
16+ }
517 // TODO type inference
618 comp . __vapor = true
719 return comp
You can’t perform that action at this time.
0 commit comments