Skip to content

Commit dfe3b9d

Browse files
committed
update customElement init logic to omit component styles for the default component if 'css' is false in compiler config
1 parent 3993b95 commit dfe3b9d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/compiler/compile/render_dom/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,10 @@ export default function dom(
525525
body.push(styledDeclaration);
526526

527527
body.push(b`
528-
const ${name} = createStyledElement('${css.code && css.code.replace(/\\/g, '\\\\')}${options.dev ? `\n/*# sourceMappingURL=${css.map.toUrl()} */` : ''}');
528+
const ${name} = createStyledElement('${options.css ? (
529+
(css.code || '').replace(/\\/g, '\\\\')
530+
+ (options.dev && `\n/*# sourceMappingURL=${css.map.toUrl()} */`)
531+
) : ''}');
529532
`)
530533

531534
if (component.tag != null) {

0 commit comments

Comments
 (0)