mirror of
https://github.com/directus/directus.git
synced 2026-04-25 03:00:53 -04:00
Add shared javascript file ext constant (#18350)
* Add shared javascript file ext constant * Add changeset
This commit is contained in:
committed by
GitHub
parent
c016664ded
commit
af2ce35d67
@@ -2,6 +2,7 @@ import {
|
||||
APP_EXTENSION_TYPES,
|
||||
APP_SHARED_DEPS,
|
||||
HYBRID_EXTENSION_TYPES,
|
||||
JAVASCRIPT_FILE_EXTS,
|
||||
NESTED_EXTENSION_TYPES,
|
||||
} from '@directus/constants';
|
||||
import * as sharedExceptions from '@directus/exceptions';
|
||||
@@ -298,15 +299,14 @@ class ExtensionManager {
|
||||
|
||||
const localExtensionUrls = NESTED_EXTENSION_TYPES.flatMap((type) => {
|
||||
const typeDir = path.posix.join(extensionDirUrl, pluralize(type));
|
||||
const fileExts = ['js', 'mjs', 'cjs'];
|
||||
|
||||
if (isIn(type, HYBRID_EXTENSION_TYPES)) {
|
||||
return [
|
||||
path.posix.join(typeDir, '*', `app.{${fileExts.join()}}`),
|
||||
path.posix.join(typeDir, '*', `api.{${fileExts.join()}}`),
|
||||
path.posix.join(typeDir, '*', `app.{${JAVASCRIPT_FILE_EXTS.join()}}`),
|
||||
path.posix.join(typeDir, '*', `api.{${JAVASCRIPT_FILE_EXTS.join()}}`),
|
||||
];
|
||||
} else {
|
||||
return path.posix.join(typeDir, '*', `index.{${fileExts.join()}}`);
|
||||
return path.posix.join(typeDir, '*', `index.{${JAVASCRIPT_FILE_EXTS.join()}}`);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user