Skip to content

Commit

Permalink
feat: output ssr render function when target is node
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Sep 11, 2020
1 parent c30c4c7 commit e691f6b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export default function loader(
templateImport,
scriptImport,
stylesCode,
templateImport ? `script.render = render` : ``
templateImport ? `script.${isServer ? `ssrRender` : `render`} = render` : ``
]
.filter(Boolean)
.join('\n')
Expand Down
1 change: 1 addition & 0 deletions src/templateLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const TemplateLoader: webpack.loader.Loader = function(source, inMap) {
source,
inMap,
filename: loaderContext.resourcePath,
ssr: loaderContext.target === 'node',
compiler,
compilerOptions: {
...options.compilerOptions,
Expand Down

0 comments on commit e691f6b

Please sign in to comment.