From a798233c57e550724859afa030c371a7a6df359a Mon Sep 17 00:00:00 2001 From: Chris Manson Date: Wed, 4 Oct 2023 13:20:52 +0100 Subject: [PATCH] use realpath of engine's route when building resolver.json --- packages/compat/src/compat-app-builder.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/compat/src/compat-app-builder.ts b/packages/compat/src/compat-app-builder.ts index 5ce39015d..885117191 100644 --- a/packages/compat/src/compat-app-builder.ts +++ b/packages/compat/src/compat-app-builder.ts @@ -35,7 +35,7 @@ import mergeWith from 'lodash/mergeWith'; import cloneDeep from 'lodash/cloneDeep'; import { sync as resolveSync } from 'resolve'; import bind from 'bind-decorator'; -import { outputJSONSync, readJSONSync, rmSync, statSync, unlinkSync, writeFileSync } from 'fs-extra'; +import { outputJSONSync, readJSONSync, rmSync, statSync, unlinkSync, writeFileSync, realpathSync } from 'fs-extra'; import type { Options as EtcOptions } from 'babel-plugin-ember-template-compilation'; import type { Options as ResolverTransformOptions } from './resolver-transform'; import type { Options as AdjustImportsOptions } from './babel-plugin-adjust-imports'; @@ -285,7 +285,9 @@ export class CompatAppBuilder { appRoot: this.origAppPackage.root, engines: engines.map((appFiles, index) => ({ packageName: appFiles.engine.package.name, - root: index === 0 ? this.root : appFiles.engine.package.root, // first engine is the app, which has been relocated to this.root + // first engine is the app, which has been relocated to this.root + // we need to use the real path here because webpack requests always use the real path i.e. follow symlinks + root: realpathSync(index === 0 ? this.root : appFiles.engine.package.root), fastbootFiles: appFiles.fastbootFiles, activeAddons: [...appFiles.engine.addons] .map(a => ({