newspack-scripts 4.3.5 → 4.3.6
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 +20 -18
package/package.json
CHANGED
package/scripts/build.js
CHANGED
|
@@ -4,25 +4,27 @@ const spawn = require("cross-spawn");
|
|
|
4
4
|
const modules = require("./utils/modules");
|
|
5
5
|
const utils = require("./utils/index.js");
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
if (process.env.CI) {
|
|
8
|
+
// HACK: For some reason, `@automattic/calypso-build` is erroring with a cryptic
|
|
9
|
+
// `HookWebpackError: error:0308010C:digital envelope routines::unsupported` error.
|
|
10
|
+
// Reinstalling the package in the newspack-scripts directory fixes the issue. No idea how.
|
|
11
|
+
// Downside is longer build times, but maybe this will be fixed in the future.
|
|
12
|
+
utils.log("Reinstalling @automattic/calypso-build…");
|
|
13
|
+
const calypsoReinstallResult = spawn.sync(
|
|
14
|
+
"cd node_modules/newspack-scripts && npm i @automattic/calypso-build --legacy-peer-deps",
|
|
15
|
+
[],
|
|
16
|
+
{
|
|
17
|
+
shell: true,
|
|
18
|
+
cwd: modules.rootDirectory,
|
|
19
|
+
stdio: "inherit",
|
|
20
|
+
}
|
|
21
|
+
);
|
|
22
|
+
if (calypsoReinstallResult.status === 0) {
|
|
23
|
+
utils.log("Calypso reinstall successful.");
|
|
24
|
+
} else {
|
|
25
|
+
utils.log("Calypso reinstall failed:");
|
|
26
|
+
console.log(calypsoReinstallResult);
|
|
19
27
|
}
|
|
20
|
-
);
|
|
21
|
-
if (calypsoReinstallResult.status === 0) {
|
|
22
|
-
utils.log("Calypso reinstall successful.");
|
|
23
|
-
} else {
|
|
24
|
-
utils.log("Calypso reinstall failed:");
|
|
25
|
-
console.log(calypsoReinstallResult);
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
utils.log("Starting to build…");
|