diff --git a/packages/compat/src/compat-app-builder.ts b/packages/compat/src/compat-app-builder.ts index 978411314..515192d79 100644 --- a/packages/compat/src/compat-app-builder.ts +++ b/packages/compat/src/compat-app-builder.ts @@ -488,7 +488,6 @@ export class CompatAppBuilder { this.addResolverConfig(resolverConfig); this.addContentForConfig(contentForConfig); this.addEmberEnvConfig(config.EmberENV); - this.addAppBoot(this.compatApp.appBoot.readAppBoot()); this.outputAppBootError(config.modulePrefix, config.APP, contentForConfig); let babelConfig = await this.babelConfig(resolverConfig); this.addBabelConfig(babelConfig); @@ -602,10 +601,6 @@ export class CompatAppBuilder { }); } - private addAppBoot(appBoot?: string) { - writeFileSync(join(locateEmbroiderWorkingDir(this.compatApp.root), 'ember-app-boot.js'), appBoot ?? ''); - } - // Classic addons providing custom content-for "app-boot" is no longer supported. // The purpose of this error message is to help developers to move the classic addons code. // Developers can deactivate it with useAddonAppBoot build option. diff --git a/packages/compat/src/compat-app.ts b/packages/compat/src/compat-app.ts index 84c9f64af..963df0d97 100644 --- a/packages/compat/src/compat-app.ts +++ b/packages/compat/src/compat-app.ts @@ -12,7 +12,6 @@ import { WatchedDir } from 'broccoli-source'; import resolve from 'resolve'; import ContentForConfig from './content-for-config'; import { V1Config } from './v1-config'; -import { WriteV1AppBoot, ReadV1AppBoot } from './v1-appboot'; import type { AddonMeta, EmberAppInstance, OutputFileToInputFileMap, PackageInfo } from '@embroider/core'; import { writeJSONSync, ensureDirSync, copySync, pathExistsSync, existsSync, writeFileSync } from 'fs-extra'; import AddToTree from './add-to-tree'; @@ -164,22 +163,6 @@ export default class CompatApp { return this.legacyEmberAppInstance.options.autoRun; } - @Memoize() - get appBoot(): ReadV1AppBoot { - let env = this.legacyEmberAppInstance.env; - let appBootContentTree = new WriteV1AppBoot(); - - let patterns = this.configReplacePatterns; - - appBootContentTree = new this.configReplace(appBootContentTree, this.configTree, { - configPath: join('environments', `${env}.json`), - files: ['config/app-boot.js'], - patterns, - }); - - return new ReadV1AppBoot(appBootContentTree); - } - private get storeConfigInMeta(): boolean { return this.legacyEmberAppInstance.options.storeConfigInMeta; } @@ -747,7 +730,6 @@ export default class CompatApp { publicTree, configTree, contentForTree, - appBootTree: this.appBoot, prevStageTree, }; } diff --git a/packages/compat/src/v1-appboot.ts b/packages/compat/src/v1-appboot.ts deleted file mode 100644 index 1ae5a42a2..000000000 --- a/packages/compat/src/v1-appboot.ts +++ /dev/null @@ -1,44 +0,0 @@ -import Plugin from 'broccoli-plugin'; -import type { Node } from 'broccoli-node-api'; -import { join } from 'path'; -import { readFileSync, outputFileSync } from 'fs-extra'; - -export class WriteV1AppBoot extends Plugin { - private lastContents: string | undefined; - constructor() { - super([], { - persistentOutput: true, - needsCache: false, - }); - } - build() { - let filename = join(this.outputPath, 'config/app-boot.js'); - let contents = `{{content-for "app-boot"}}`; - if (!this.lastContents || this.lastContents !== contents) { - outputFileSync(filename, contents); - } - this.lastContents = contents; - } -} - -export class ReadV1AppBoot extends Plugin { - private appBoot: string | undefined; - private hasBuilt = false; - constructor(appBootTree: Node) { - super([appBootTree], { - persistentOutput: true, - needsCache: false, - }); - } - build() { - this.appBoot = readFileSync(join(this.inputPaths[0], `config/app-boot.js`), 'utf8'); - this.hasBuilt = true; - } - - readAppBoot() { - if (!this.hasBuilt) { - throw new Error(`AppBoot not available until after the build`); - } - return this.appBoot; - } -}