@netlify/build 18.25.0 → 18.25.1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@netlify/build",
3
- "version": "18.25.0",
3
+ "version": "18.25.1",
4
4
  "description": "Netlify build module",
5
5
  "main": "src/core/main.js",
6
6
  "types": "types/index.d.ts",
@@ -26,7 +26,17 @@ const addTsErrorInfo = async function (error, pluginPath) {
26
26
  return
27
27
  }
28
28
 
29
- const { stdout } = await execa.command('ts-node --show-config')
29
+ const { stdout } = await execa.command('ts-node --show-config', {
30
+ // `ts-node` is located inside `@netlify/build` `node_modules` directory.
31
+ // `preferLocal: true` ensures any parent `node_modules/.bin/` directory
32
+ // is searched.
33
+ // It does so starting from `localDir`, which defaults to `process.cwd()`.
34
+ // The current directory is the plugin's main file's directory.
35
+ // Therefore it needs to be changed to `__dirname` to be able to find
36
+ // `ts-node` binary.
37
+ localDir: __dirname,
38
+ preferLocal: true,
39
+ })
30
40
  const tsConfig = safeJsonParse(stdout)
31
41
  addErrorInfo(error, { tsConfig })
32
42
  }