From 7eecc84f4d9a7be5335faa3926e445db7d80499d Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Thu, 15 Jul 2021 13:08:14 +0200 Subject: [PATCH] fix(nitro): fix externals regex for scoped packages closes #238 --- packages/nitro/src/rollup/plugins/externals.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/nitro/src/rollup/plugins/externals.ts b/packages/nitro/src/rollup/plugins/externals.ts index 8f86e68fe0..5fc973ddd1 100644 --- a/packages/nitro/src/rollup/plugins/externals.ts +++ b/packages/nitro/src/rollup/plugins/externals.ts @@ -65,7 +65,7 @@ export function externals (opts: NodeExternalsOptions): Plugin { const pkgs = new Set() for (const file of tracedFiles) { // eslint-disable-next-line @typescript-eslint/no-unused-vars - const [_, baseDir, pkgName, _importPath] = /(.+\/node_modules\/)([^/]+)\/(.*)/.exec(file) + const [_, baseDir, pkgName, _importPath] = /(.+\/node_modules\/)([^@/]+|@[^/]+\/[^/]+)\/(.*)/.exec(file) pkgs.add(resolve(baseDir, pkgName, 'package.json')) }