Skip to content

Commit

Permalink
Merge pull request #2255 from embroider-build/staticEmberSource-error
Browse files Browse the repository at this point in the history
throw an error if someone has set staticEmberSource=false
  • Loading branch information
ef4 authored Feb 11, 2025
2 parents 5d79e14 + f608198 commit 13ee6e9
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 @@ -80,10 +80,16 @@ const defaults = Object.assign(coreWithDefaults(), {
export type CompatOptionsType = Required<Options>;

export function optionsWithDefaults(options?: Options): CompatOptionsType {
if (!(options as any)?.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 as any)?.staticEmberSource !== undefined) {
Expand Down

0 comments on commit 13ee6e9

Please sign in to comment.