prepareNpmPackage() — react Function Reference
Architecture documentation for the prepareNpmPackage() function in packaging.js from the react codebase.
Entity Profile
Dependency Diagram
graph TD 7c67dee2_eb13_96b1_25ba_6fce3f0ea220["prepareNpmPackage()"] fef369e3_6dfd_944a_16c1_5addc35f485d["packaging.js"] 7c67dee2_eb13_96b1_25ba_6fce3f0ea220 -->|defined in| fef369e3_6dfd_944a_16c1_5addc35f485d 331d1458_b7bf_3efa_ecd7_4dabd174a520["filterOutEntrypoints()"] 7c67dee2_eb13_96b1_25ba_6fce3f0ea220 -->|calls| 331d1458_b7bf_3efa_ecd7_4dabd174a520 bcf5b089_7957_6ac7_9df4_1f67f7399eae["getTarOptions()"] 7c67dee2_eb13_96b1_25ba_6fce3f0ea220 -->|calls| bcf5b089_7957_6ac7_9df4_1f67f7399eae style 7c67dee2_eb13_96b1_25ba_6fce3f0ea220 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
scripts/rollup/packaging.js lines 253–273
async function prepareNpmPackage(name) {
await Promise.all([
asyncCopyTo('LICENSE', `build/node_modules/${name}/LICENSE`),
asyncCopyTo(
`packages/${name}/package.json`,
`build/node_modules/${name}/package.json`
),
asyncCopyTo(
`packages/${name}/README.md`,
`build/node_modules/${name}/README.md`
),
asyncCopyTo(`packages/${name}/npm`, `build/node_modules/${name}`),
]);
filterOutEntrypoints(name);
const tgzName = (
await asyncExecuteCommand(`npm pack build/node_modules/${name}`)
).trim();
await asyncRimRaf(`build/node_modules/${name}`);
await asyncExtractTar(getTarOptions(tgzName, name));
unlinkSync(tgzName);
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does prepareNpmPackage() do?
prepareNpmPackage() is a function in the react codebase, defined in scripts/rollup/packaging.js.
Where is prepareNpmPackage() defined?
prepareNpmPackage() is defined in scripts/rollup/packaging.js at line 253.
What does prepareNpmPackage() call?
prepareNpmPackage() calls 2 function(s): filterOutEntrypoints, getTarOptions.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free