Skip to content

Commit 8b9f92d

Browse files
authored
chore(rollup): use less confusing implementation for default true (#5263)
* chore(rollup): use less confusing implementation for default true * chore(rollup): use least confusing implementation for default true * chore(rollup-plugin): use correcter simpler implementation turns out I didn't fully understand the original implementation!
1 parent acf14be commit 8b9f92d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/@lwc/rollup-plugin/src/index.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,12 @@ export default function lwc(pluginOptions: RollupLwcOptions = {}): Plugin {
370370
scopedStyles: scoped,
371371
disableSyntheticShadowSupport,
372372
apiVersion: apiVersionToUse,
373-
// Only pass this in if it's actually specified – otherwise unspecified becomes undefined becomes false
374-
...('enableStaticContentOptimization' in pluginOptions && {
375-
enableStaticContentOptimization: pluginOptions.enableStaticContentOptimization,
376-
}),
373+
enableStaticContentOptimization:
374+
// {enableStaticContentOptimization:undefined} behaves like `false`
375+
// but {} (prop unspecified) behaves like `true`
376+
'enableStaticContentOptimization' in pluginOptions
377+
? pluginOptions.enableStaticContentOptimization
378+
: true,
377379
targetSSR,
378380
ssrMode,
379381
});

0 commit comments

Comments
 (0)