File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -132,17 +132,17 @@ async function main(argv = process.argv) {
132132 const prebuildsFinds = await find ( prebuildsPath , / .n o d e $ / ) ;
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 ] ;
You can’t perform that action at this time.
0 commit comments