Skip to content

Commit

Permalink
Don't pass falsy locals to glimmer precompile
Browse files Browse the repository at this point in the history
  • Loading branch information
ef4 committed Oct 22, 2021
1 parent 375dd0f commit d9a83a4
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,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 d9a83a4

Please sign in to comment.