Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions scripts/build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,10 @@ async function build() {

async function buildPackage(packageName /*: string */, prepack /*: boolean */) {
try {
process.stdout.write(
`${packageName} ${styleText('dim', '.').repeat(72 - packageName.length)} `,
);

const {emitTypeScriptDefs} = getBuildOptions(packageName);
const entryPoints = await getEntryPoints(packageName);

Expand All @@ -98,10 +102,6 @@ async function buildPackage(packageName /*: string */, prepack /*: boolean */) {
!entryPoints.has(file.replace(/\.js$/, '.flow.js')),
);

process.stdout.write(
`${packageName} ${styleText('dim', '.').repeat(72 - packageName.length)} `,
);

// Build regular files
for (const file of files) {
await buildFile(path.normalize(file), {
Expand Down Expand Up @@ -299,6 +299,15 @@ async function getEntryPoints(
continue;
}

if (target.startsWith('./' + BUILD_DIR + '/')) {
throw new Error(
`Found ./${BUILD_DIR}/* entry in package.json exports for ` +
`${packageName}. This is either a misconfiguration, or the ` +
`prepack script was previously run and the package.json state ` +
`is dirty. Please re-run against a clean working copy.`,
);
}

if (target.includes('*')) {
console.warn(
`${styleText('yellow', 'Warning')}: Encountered subpath pattern ${subpath}` +
Expand Down
Loading