Skip to content

Commit e41f883

Browse files
committed
Fix projects with empty HTML
1 parent fec54fc commit e41f883

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/app/src/sandbox/compile.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export function getCurrentManager(): ?Manager {
4141
return manager;
4242
}
4343

44-
export function getHTMLParts(html: string = '') {
44+
export function getHTMLParts(html: string) {
4545
if (html.includes('<body>')) {
4646
const bodyMatcher = /<body>([\s\S]*)<\/body>/m;
4747
const headMatcher = /<head>([\s\S]*)<\/head>/m;
@@ -469,7 +469,7 @@ async function compile({
469469
const htmlModule = modules[htmlModulePath];
470470

471471
const { head, body } = getHTMLParts(
472-
htmlModule
472+
htmlModule && htmlModule.code
473473
? htmlModule.code
474474
: template === 'vue-cli'
475475
? '<div id="app"></div>'

0 commit comments

Comments
 (0)