Skip to content

Commit

Permalink
convert staticEmberSource warning to an error
Browse files Browse the repository at this point in the history
  • Loading branch information
mansona committed Feb 8, 2025
1 parent 311ee27 commit e7b7876
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions packages/compat/src/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,16 @@ export type CompatOptionsType = Required<
Pick<Options, 'staticHelpers' | 'staticModifiers' | 'staticComponents' | 'staticInvokables'>;

export function optionsWithDefaults(options?: Options): CompatOptionsType {
if (!options?.staticEmberSource) {
console.log(
`The setting 'staticEmberSource' will default to true in the next version of Embroider and can't be turned off. To prepare for this you should set 'staticEmberSource: true' in your Embroider config.`
);
if ((options as any)?.staticEmberSource !== undefined) {
if ((options as any).staticEmberSource === false) {
throw new Error(
`You have set 'staticEmberSource' to 'false' in your Embroider options. This option has been removed is always considered to have the value 'true'. Please remove this setting to continue.`
);
} else {
console.log(
`You have set 'staticEmberSource' in your Embroider options. This can safely be removed now and it defaults to true.`
);
}
}

if (!options?.staticAddonTrees) {
Expand Down

0 comments on commit e7b7876

Please sign in to comment.