Skip to content

Commit a48be5a

Browse files
authored
Merge pull request #189 from hashicorp/ds.tools-resolve-next
2 parents 5fc2a2a + cb02c01 commit a48be5a

File tree

4 files changed

+58
-7
lines changed

4 files changed

+58
-7
lines changed

.changeset/large-months-mix.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@hashicorp/platform-tools': minor
3+
---
4+
5+
Correctly find the next executable in monorepos

package-lock.json

Lines changed: 45 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/tools/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"@types/yargs": "^17.0.19",
1414
"ts-node": "^10.7.0",
1515
"tsconfig-paths": "^3.14.1",
16+
"which": "^3.0.0",
1617
"yargs": "^17.4.1"
1718
},
1819
"scripts": {
@@ -28,5 +29,8 @@
2829
"bugs": {
2930
"url": "https://github.com/hashicorp/web-platform-packages/issues"
3031
},
31-
"homepage": "https://github.com/hashicorp/web-platform-packages#readme"
32+
"homepage": "https://github.com/hashicorp/web-platform-packages#readme",
33+
"devDependencies": {
34+
"@types/which": "^3.0.0"
35+
}
3236
}

packages/tools/scripts/next-build-webpack-only/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
import { spawn } from 'child_process'
2+
import which from 'which'
23

34
/**
45
* Wrap the next build command to only run the webpack step of the build, short-circuiting before static generation.
56
*/
67
export default async function main() {
7-
const buildProc = spawn('./node_modules/.bin/next', ['build'], {
8+
const nextBin = await which('next')
9+
const buildProc = spawn(nextBin, ['build'], {
810
env: { ...process.env, FORCE_COLOR: 'true' },
911
})
1012

0 commit comments

Comments
 (0)