Fix starting Directus using a custom start file (#15574)

This should resolve #15091 without breaking #14728.
This commit is contained in:
Nicola Krumschmidt
2022-09-14 18:47:02 +02:00
committed by GitHub
parent 9b24233aa4
commit 6bcd514161
2 changed files with 2 additions and 4 deletions

View File

@@ -179,7 +179,7 @@ export default async function createApp(): Promise<express.Application> {
});
if (env.SERVE_APP) {
const adminPath = require.resolve('@directus/app', require.main ? { paths: [require.main.filename] } : undefined);
const adminPath = require.resolve('@directus/app');
const adminUrl = new Url(env.PUBLIC_URL).addPath('admin');
// Set the App's base path according to the APIs public URL

View File

@@ -324,9 +324,7 @@ class ExtensionManager {
}
private async getSharedDepsMapping(deps: string[]) {
const appDir = await fse.readdir(
path.join(resolvePackage('@directus/app', require.main?.filename), 'dist', 'assets')
);
const appDir = await fse.readdir(path.join(resolvePackage('@directus/app', __dirname), 'dist', 'assets'));
const depsMapping: Record<string, string> = {};
for (const dep of deps) {