Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix(web): npm dependencies from the project graph (#6843)
get the npm dependencies from the project graph correctly. Allow deep import from `externals` passed from settings

Co-authored-by: Zakir Nuriiev <zakir.nuriev@caspio.com>
  • Loading branch information
kazamov and Zakir Nuriiev committed Sep 2, 2021
1 parent b416bb6 commit 804cc73
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/web/src/executors/package/package.impl.ts
Expand Up @@ -73,7 +73,7 @@ export default async function* run(
const options = normalizePackageOptions(rawOptions, context.root, sourceRoot);
const packageJson = readJsonFile(options.project);

const npmDeps = (projectGraph[context.projectName] ?? [])
const npmDeps = (projectGraph.dependencies[context.projectName] ?? [])
.filter((d) => d.target.startsWith('npm:'))
.map((d) => d.target.substr(4));

Expand Down Expand Up @@ -239,8 +239,9 @@ export function createRollupOptions(
name: options.umdName || names(context.projectName).className,
},
external: (id) =>
externalPackages.includes(id) ||
npmDeps.some((name) => id === name || id.startsWith(`${name}/`)), // Could be a deep import
externalPackages.some(
(name) => id === name || id.startsWith(`${name}/`)
) || npmDeps.some((name) => id === name || id.startsWith(`${name}/`)), // Could be a deep import
plugins,
};

Expand Down

0 comments on commit 804cc73

Please sign in to comment.