Skip to content

Commit 93ceb48

Browse files
committed
Build packages before building the website
The website uses the pre-built versions of react-router and react-router-dom, so we need to make sure they are built first.
1 parent 48a46d6 commit 93ceb48

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

scripts/build.js

+24-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,30 @@
1+
const path = require("path");
12
const execSync = require("child_process").execSync;
23

3-
function exec(cmd, env) {
4+
function exec(cmd) {
45
execSync(cmd, { stdio: "inherit", env: process.env });
56
}
67

7-
if (process.env.CI) {
8-
exec("lerna run build --stream --ignore react-router-website");
9-
} else {
10-
exec("lerna run build --stream");
8+
const cwd = process.cwd();
9+
10+
// Note: We don't currently have a build step for react-router-native.
11+
// Instead, we use the source files directly.
12+
["react-router", "react-router-dom", "react-router-config"].forEach(
13+
packageName => {
14+
console.log("Building %s ...", packageName);
15+
process.chdir(path.resolve(__dirname, "../packages/" + packageName));
16+
exec("npm run build");
17+
console.log();
18+
}
19+
);
20+
21+
if (!process.env.CI) {
22+
// Don't bother building the website now. Instead, build it in
23+
// deploy-website.sh when we're on the "website" branch.
24+
console.log("Building the website ...");
25+
process.chdir(path.resolve(__dirname, "../website"));
26+
exec("npm run build");
27+
console.log();
1128
}
29+
30+
process.chdir(cwd);

0 commit comments

Comments
 (0)