Skip to content

Commit

Permalink
Don't pass falsy locals to glimmer precompile
Browse files Browse the repository at this point in the history
Fixes #19797.

(cherry picked from commit d9a83a4)
  • Loading branch information
ef4 authored and rwjblue committed Oct 22, 2021
1 parent 6932490 commit 1402cb4
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ export function buildCompileOptions(_options: EmberPrecompileOptions): EmberPrec
options.locals = undefined;
}

if ('locals' in options && !options.locals) {
// Glimmer's precompile options declare `locals` like:
// locals?: string[]
// but many in-use versions of babel-plugin-htmlbars-inline-precompile will
// set locals to `null`. This used to work but only because glimmer was
// ignoring locals for non-strict templates, and now it supports that case.
delete options.locals;
}

// move `moduleName` into `meta` property
if (options.moduleName) {
let meta = options.meta;
Expand Down

0 comments on commit 1402cb4

Please sign in to comment.