Skip to content

Commit

Permalink
chore(plugin-vue): define renderFnName if necessary (#1357)
Browse files Browse the repository at this point in the history
  • Loading branch information
edison1105 committed Jan 5, 2021
1 parent da57335 commit 1cd0590
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/plugin-vue/src/main.ts
Expand Up @@ -153,7 +153,6 @@ function genTemplateCode(
options: ResolvedOptions,
pluginContext: PluginContext
) {
const renderFnName = options.ssr ? 'ssrRender' : 'render'
const template = descriptor.template!

// If the template is not using pre-processor AND is not using external src,
Expand All @@ -175,6 +174,7 @@ function genTemplateCode(
const attrsQuery = attrsToQuery(template.attrs, 'js', true)
const query = `?vue&type=template${srcQuery}${attrsQuery}`
const request = JSON.stringify(src + query)
const renderFnName = options.ssr ? 'ssrRender' : 'render'
return {
code: `import { ${renderFnName} as _sfc_${renderFnName} } from ${request}`,
map: undefined
Expand Down

0 comments on commit 1cd0590

Please sign in to comment.