Skip to content

🎥 Make videos programmatically with React

skip build for node 14

Jonny Burgerd2cac8da0602
diff --git a/packages/astro-example/build.mjs b/packages/astro-example/build.mjs
new file mode 100644
index 0000000000..f227d71635
--- /dev/null
+++ b/packages/astro-example/build.mjs
@@ -0,0 +1,20 @@
+import { execSync } from "child_process";
+
+const nodeVersion = execSync("node -v");
+const str = nodeVersion.toString().trim();
+const version = str.match(/v([0-9]+)./);
+
+if (!version) {
+ console.log("Node not installed, skipping");
+ process.exit(0);
+}
+
+const majorVersion = parseInt(version[1], 10);
+if (majorVersion < 16) {
+ console.log("Astro does not support this version, skipping build.");
+ process.exit(0);
+}
+
+execSync("pnpm exec astro build", {
+ stdio: "inherit",
+});
diff --git a/packages/astro-example/package.json b/packages/astro-example/package.json
index 8de25f2670..ea5d0ae5a2 100644
--- a/packages/astro-example/package.json
+++ b/packages/astro-example/package.json
@@ -5,7 +5,7 @@
"scripts": {
"dev": "astro dev",
"start": "astro dev",
- "build": "astro build",
+ "build": "node build.mjs",
"preview": "astro preview",
"astro": "astro"
},