Skip to content

Commit 3e4e7b7

Browse files
committed
refactor(build): simplify node-gyp string replacement regex
Simplify the regex pattern to match just the string literal instead of the entire require.resolve() call. This makes the code cleaner and easier to understand while maintaining the same functionality.
1 parent 044122b commit 3e4e7b7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/build-externals/orchestrator.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,8 +209,8 @@ async function fixNodeGypStrings(dir, options = {}) {
209209
if (contents.includes('node-gyp/bin/node-gyp.js')) {
210210
// Replace literal string with concatenated version
211211
const fixed = contents.replace(
212-
/require\.resolve\(["']node-gyp\/bin\/node-gyp\.js["']\)/g,
213-
'require.resolve("node-" + "gyp/bin/node-gyp.js")',
212+
/["']node-gyp\/bin\/node-gyp\.js["']/g,
213+
'"node-" + "gyp/bin/node-gyp.js"',
214214
)
215215

216216
await fs.writeFile(filePath, fixed, 'utf8')

0 commit comments

Comments
 (0)