Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(web): npm dependencies from the project graph #6843

Merged
merged 1 commit into from Sep 2, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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