Skip to content

Commit da0e1cb

Browse files
committed
WIP
1 parent 3891644 commit da0e1cb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

scripts/pkg.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -132,17 +132,17 @@ async function main(argv = process.argv) {
132132
const prebuildsFinds = await find(prebuildsPath, /.node$/);
133133
if (buildFinds.length > 0 || prebuildsFinds.length > 0) {
134134
let nativeAddonPath = nodeGypBuild.path(nodePackage);
135-
// Use relative paths
135+
// Must use relative paths
136+
// so that assets are added relative to the project
136137
nativeAddonPath = path.relative(projectRoot, nativeAddonPath);
137138
pkgConfig.assets.push(nativeAddonPath);
138139
}
139140
}
140141
console.error('Configured pkg with:');
141142
console.error(pkgConfig);
142-
const pkgConfigPath = path.join(
143-
os.tmpdir(),
144-
`pkg-bundle-config-${randomString(6)}.json`
145-
);
143+
// The pkg config must be in the same directory as the `package.json`
144+
// otherwise the relative paths won't work
145+
const pkgConfigPath = path.join(projectRoot, 'pkg.json');
146146
await fs.promises.writeFile(pkgConfigPath, JSON.stringify(pkgConfig));
147147
const pkgPlatform = platforms[platform];
148148
const pkgArch = archs[arch];

0 commit comments

Comments
 (0)