From e57a97b2af8dd2e63f59693270cbb8837123720b Mon Sep 17 00:00:00 2001 From: qinmu Date: Fri, 6 May 2022 14:19:25 +0800 Subject: [PATCH] chore: revert 'removal' of component.compile_options.dev --- src/compiler/compile/render_dom/index.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/compiler/compile/render_dom/index.ts b/src/compiler/compile/render_dom/index.ts index 6c1590d4d1..5e9fe8b1bd 100644 --- a/src/compiler/compile/render_dom/index.ts +++ b/src/compiler/compile/render_dom/index.ts @@ -333,10 +333,8 @@ export default function dom( // $$props arg is still needed for unknown prop check args.push(x`$$props`); } - // fix: remove "component.compile_options.dev" condition, which - // will set has_create_fragment always be true in dev mode, - // inconsistent with the behavior in production mode. - const has_create_fragment = block.has_content(); + // has_create_fragment is intentionally to be true in dev mode. + const has_create_fragment = component.compile_options.dev || block.has_content(); if (has_create_fragment) { body.push(b` function create_fragment(#ctx) {