newspack-scripts 4.3.4 → 4.3.5-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/build.js +24 -3
package/package.json
CHANGED
package/scripts/build.js
CHANGED
|
@@ -4,14 +4,35 @@ const spawn = require("cross-spawn");
|
|
|
4
4
|
const modules = require("./utils/modules");
|
|
5
5
|
const utils = require("./utils/index.js");
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
utils.log("Starting to build…");
|
|
8
|
+
|
|
9
|
+
const calypsoReinstallResult = spawn.sync(
|
|
10
|
+
process.execPath,
|
|
11
|
+
[
|
|
12
|
+
"cd",
|
|
13
|
+
"node_modules/newspack-scripts",
|
|
14
|
+
"&&",
|
|
15
|
+
"npm",
|
|
16
|
+
"install",
|
|
17
|
+
"--legacy-peer-deps",
|
|
18
|
+
],
|
|
19
|
+
{
|
|
20
|
+
cwd: modules.rootDirectory,
|
|
21
|
+
stdio: "inherit",
|
|
22
|
+
}
|
|
23
|
+
);
|
|
24
|
+
if (calypsoReinstallResult.status === 0) {
|
|
25
|
+
utils.log("Calypso reinstall successful.");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const buildResult = spawn.sync(process.execPath, [modules.calypsoBuild], {
|
|
8
29
|
cwd: modules.rootDirectory,
|
|
9
30
|
stdio: "inherit",
|
|
10
31
|
env: { ...process.env, NODE_ENV: "production" },
|
|
11
32
|
});
|
|
12
33
|
|
|
13
|
-
if (
|
|
34
|
+
if (buildResult.status === 0) {
|
|
14
35
|
utils.log("Build succeeded!");
|
|
15
36
|
}
|
|
16
37
|
|
|
17
|
-
process.exit(
|
|
38
|
+
process.exit(buildResult.status);
|