Skip to content

Commit ecafff2

Browse files
committed
fix(): skip initHtml when not serving
1 parent a471074 commit ecafff2

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

src/compiler/build/init-index-html.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,11 @@ export async function initIndexHtmls(config: d.Config, compilerCtx: d.CompilerCt
77
// The initial loading page connects with the stencil's devServer
88
// If we are building without server, it does not make sense to write the
99
// initial index.html
10-
if (!config.devServer) {
11-
return;
10+
if (config.flags.serve) {
11+
await Promise.all(config.outputTargets.map(async outputTarget => {
12+
await initIndexHtml(config, compilerCtx, buildCtx, outputTarget);
13+
}));
1214
}
13-
await Promise.all(config.outputTargets.map(async outputTarget => {
14-
await initIndexHtml(config, compilerCtx, buildCtx, outputTarget);
15-
}));
1615
}
1716

1817

0 commit comments

Comments
 (0)