fix: require module (#3277)

* fix: require module

* fix: include utils
This commit is contained in:
chenos 2023-12-28 13:40:11 +08:00 committed by GitHub
parent 80335aa23c
commit 8108107779
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -11,6 +11,7 @@ on:
- 'packages/core/actions/**'
- 'packages/core/database/**'
- 'packages/core/server/**'
- 'packages/core/utils/**'
- 'packages/plugins/**/src/server/**'
- '.github/workflows/nocobase-test-backend.yml'
pull_request:
@ -20,6 +21,7 @@ on:
- 'packages/core/actions/**'
- 'packages/core/database/**'
- 'packages/core/server/**'
- 'packages/core/utils/**'
- 'packages/plugins/**/src/server/**'
- '.github/workflows/nocobase-test-backend.yml'

View File

@ -16,6 +16,10 @@ export function requireModule(m: any) {
export default requireModule;
export async function importModule(m: string) {
if (!process.env.VITEST) {
return requireModule(m);
}
if (path.isAbsolute(m)) {
m = pathToFileURL(m).href;
}