Skip to content

Commit

Permalink
add build_out_root default
Browse files Browse the repository at this point in the history
  • Loading branch information
fiji-flo committed Dec 17, 2024
1 parent 0fadbb7 commit a50daa8
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
11 changes: 11 additions & 0 deletions bins/build.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
#!/usr/bin/env node
import { rariBin } from "@mdn/rari";
import { spawn } from "cross-spawn";
import { config } from "dotenv";
import path from "node:path";
import { cwd } from "node:process";

import { BUILD_OUT_ROOT } from "../libs/env/index.js";

config({
path: path.join(cwd(), process.env.ENV_FILE || ".env"),
});

process.env.BUILD_OUT_ROOT = process.env.BUILD_OUT_ROOT || BUILD_OUT_ROOT;

spawn(rariBin, ["build"], { stdio: "inherit" });
12 changes: 12 additions & 0 deletions bins/tool.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,16 @@
import { rariBin } from "@mdn/rari";
import { spawn } from "cross-spawn";

import { config } from "dotenv";
import path from "node:path";
import { cwd } from "node:process";

import { BUILD_OUT_ROOT } from "../libs/env/index.js";

config({
path: path.join(cwd(), process.env.ENV_FILE || ".env"),
});

process.env.BUILD_OUT_ROOT = process.env.BUILD_OUT_ROOT || BUILD_OUT_ROOT;

spawn(rariBin, ["content"], { stdio: "inherit" });
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"scripts": {
"ai-help-macros": "cross-env NODE_OPTIONS=\"--no-warnings=ExperimentalWarning --loader ts-node/esm\" node scripts/ai-help-macros.ts",
"analyze": "(test -f client/build/stats.json || cross-env ANALYZE_BUNDLE=true yarn build:client) && webpack-bundle-analyzer client/build/stats.json",
"build": "yarn rari build",
"build": "node bins/build.mjs",
"build:client": "cd client && cross-env NODE_ENV=production BABEL_ENV=production node scripts/build.js",
"build:dist": "tsc -p tsconfig.dist.json",
"build:glean": "cd client && cross-env VIRTUAL_ENV=venv glean translate src/telemetry/metrics.yaml src/telemetry/pings.yaml -f typescript -o src/telemetry/generated",
Expand Down Expand Up @@ -63,7 +63,7 @@
"test:libs": "yarn jest --rootDir libs --env=node",
"test:prepare": "yarn build:prepare && yarn build && yarn render:html && yarn start:static-server",
"test:testing": "yarn jest --rootDir testing",
"tool": "yarn rari content",
"tool": "node bins/tool.mjs",
"tool:legacy": "cross-env NODE_OPTIONS=\"--no-warnings=ExperimentalWarning --loader ts-node/esm\" node ./tool/cli.ts",
"watch:ssr": "webpack --mode=production --watch --config=ssr/webpack.config.js"
},
Expand Down

0 comments on commit a50daa8

Please sign in to comment.