Skip to content

Commit 5edcde6

Browse files
author
Franck Freiburger
committed
wip: fixing TS errors
1 parent 3a24177 commit 5edcde6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/createVue3SFCModule.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export async function createSFCModule(source : string, filename : AbstractPath,
9999
await loadModuleInternal({ refPath: filename, relPath: descriptor.template.lang }, options);
100100

101101

102-
const compileTemplateOptions : SFCTemplateCompileOptions|null = descriptor.template ? {
102+
const compileTemplateOptions : SFCTemplateCompileOptions|undefined = descriptor.template ? {
103103
// hack, since sourceMap is not configurable an we want to get rid of source-map dependency. see genSourcemap
104104
compiler: { ...vue_CompilerDOM, compile: (template, options) => vue_CompilerDOM.compile(template, { ...options, sourceMap: genSourcemap }) },
105105
source: descriptor.template.src ? (await (await getResource({ refPath: filename, relPath: descriptor.template.src }, options).getContent()).getContentData(false)) as string : descriptor.template.content,
@@ -118,7 +118,7 @@ export async function createSFCModule(source : string, filename : AbstractPath,
118118
// transformAssetUrls
119119
preprocessLang: descriptor.template.lang,
120120
preprocessCustomRequire: id => moduleCache[id], // makes consolidate optional, see https://github.com/vuejs/vue-next/blob/15baaf14f025f6b1d46174c9713a2ec517741d0d/packages/compiler-sfc/src/compileTemplate.ts#L111-L113
121-
} : null;
121+
} : undefined;
122122

123123
if ( descriptor.script || descriptor.scriptSetup ) {
124124

@@ -156,7 +156,7 @@ export async function createSFCModule(source : string, filename : AbstractPath,
156156
});
157157

158158
// see https://github.com/vuejs/vue-loader/blob/12aaf2ea77add8654c50c8751bad135f1881e53f/src/templateLoader.ts#L54
159-
if ( compileTemplateOptions !== null )
159+
if ( compileTemplateOptions?.compilerOptions !== undefined )
160160
compileTemplateOptions.compilerOptions.bindingMetadata = scriptBlock.bindings;
161161

162162

0 commit comments

Comments
 (0)