feat: handle externals all-monorepo option
Thanks for the PR!
I'm wondering, can we do this by default for the all option? Would it error out if we traversed up the directories and looked for a root package.json.
Sorry for the late answer, I was in holiday.
I tried using nodeExternals({ additionalModuleDirs: [path.resolve(process.cwd(), "../../node_modules")] }) on a non-monorepo project. I put the project at the top-level directory to be sure it would also work if ../../ doesn't exist. I tested it on Linux and Windows, it worked in both cases.
I will update the PR.
Thanks! We have a test case for the externals that's failing. If we can fix that, I can merge it.
Test fixed