Skip to content

Commit 8a52f1d

Browse files
committed
Fix templates with no html file in default place
Fixes codesandbox#1741
1 parent ad0e259 commit 8a52f1d

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

packages/app/src/sandbox/compile.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ async function compile({
536536

537537
manager.preset.preEvaluate(manager, updatedModules);
538538

539-
if (!manager.webpackHMR && !manager.preset.htmlDisabled) {
539+
if (!manager.webpackHMR) {
540540
const htmlModulePath = templateDefinition
541541
.getHTMLEntries(configurations)
542542
.find(p => modules[p]);
@@ -557,7 +557,7 @@ async function compile({
557557
manager.clearCompiledCache();
558558
}
559559

560-
if (!firstLoad || process.env.LOCAL_SERVER) {
560+
if (!manager.preset.htmlDisabled || !firstLoad) {
561561
// The HTML is loaded from the server as a static file, no need to set the innerHTML of the body
562562
// on the first run.
563563
document.body.innerHTML = body;

packages/app/src/sandbox/eval/presets/parcel/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export default function initialize() {
3737
],
3838
{},
3939
{
40+
htmlDisabled: true,
4041
setup: manager => {
4142
const packageJSON = manager.configurations.package;
4243

0 commit comments

Comments
 (0)