模块路径相对于当前模块进行解析,文件系统路径相对于当前工作目录进行解析。
考虑到一条路径被一个球成功匹配,
apps/...
它可以是:
const componentPaths = await globby('../apps/morningharwood/src/app/**/*.component.ts', { cwd: __dirname });
for (const path of componentPaths) {
const ref = await import(path.join('./', path));
...
或:
const componentPaths = await globby(path.join(__dirname, '../apps/morningharwood/src/app/**/*.component.ts'));
for (const path of componentPaths) {
const ref = await import(path);
...