GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fail build on deep requires in npm packages (#21063) · react/react@7b84dbd

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • scripts/rollup
    • build.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎scripts/rollup/build.js‎

Copy file name to clipboardExpand all lines: scripts/rollup/build.js
+11Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,17 @@ async function createBundle(bundle, bundleType) {
582582
const containsThisModule = pkg => id === pkg || id.startsWith(pkg + '/');
583583
const isProvidedByDependency = externals.some(containsThisModule);
584584
if (!shouldBundleDependencies && isProvidedByDependency) {
585+
if (id.indexOf('/src/') !== -1) {
586+
throw Error(
587+
'You are trying to import ' +
588+
id +
589+
' but ' +
590+
externals.find(containsThisModule) +
591+
' is one of npm dependencies, ' +
592+
'so it will not contain that source file. You probably want ' +
593+
'to create a new bundle entry point for it instead.'
594+
);
595+
}
585596
return true;
586597
}
587598
return !!peerGlobals[id];

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.