Skip to content

Commit 95a6d9e

Browse files
committed
Add node-gyp to externals
1 parent b6ba9d4 commit 95a6d9e

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

.config/rollup.base.config.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const EXTERNAL_PACKAGES = [
4040
'@socketsecurity/registry',
4141
'blessed',
4242
'blessed-contrib',
43+
'node-gyp',
4344
]
4445

4546
const builtinAliases = builtinModules.reduce((o, n) => {

.config/rollup.dist.config.mjs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -480,12 +480,15 @@ export default async () => {
480480
},
481481
],
482482
plugins: [
483-
// Replace requires like require('blessed/lib/widgets/screen') with
484-
// require('../external/blessed/lib/widgets/screen').
483+
// Replace requires like
484+
// require('blessed/lib/widgets/screen') with
485+
// require('../external/blessed/lib/widgets/screen') OR
486+
// require.resolve('node-gyp/bin/node-gyp.js') with
487+
// require.resolve('../external/node-gyp/bin/node-gyp.js')
485488
...EXTERNAL_PACKAGES.map(n =>
486489
socketModifyPlugin({
487490
find: new RegExp(
488-
`(?<=require(?:\\$+\\d+)?\\(["'])${escapeRegExp(n)}(?=(?:\\/[^"']+)?["']\\))`,
491+
`(?<=require(?:\\$+\\d+)?(?:\\.resolve)?\\(["'])${escapeRegExp(n)}(?=(?:\\/[^"']+)?["']\\))`,
489492
'g',
490493
),
491494
replace: id => `../external/${id}`,

package-lock.json

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
"micromatch": "4.0.8",
155155
"mock-fs": "5.5.0",
156156
"nock": "14.0.5",
157+
"node-gyp": "11.2.0",
157158
"npm-package-arg": "12.0.2",
158159
"npm-run-all2": "8.0.4",
159160
"open": "10.1.2",

0 commit comments

Comments
 (0)