revert: refactor: allow ES import for cloud string if package type is module

This reverts commit 0225340ccb.
This commit is contained in:
Manuel
2021-11-10 16:26:20 +01:00
committed by GitHub
parent 611bd9baaa
commit b64640c570
4 changed files with 2 additions and 18 deletions

View File

@@ -108,11 +108,7 @@ class ParseServer {
if (typeof cloud === 'function') {
cloud(Parse);
} else if (typeof cloud === 'string') {
if (process.env.npm_package_type === 'module') {
import(path.resolve(process.cwd(), cloud));
} else {
require(path.resolve(process.cwd(), cloud));
}
require(path.resolve(process.cwd(), cloud));
} else {
throw "argument 'cloud' must either be a string or a function";
}