Merge pull request #27 from vector-im/dbkr/copy_hak_modules

Add our native modules separately into the files
This commit is contained in:
David Baker 2020-02-21 11:26:14 +00:00 committed by GitHub
commit 6cb90add1d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 3 deletions

View File

@ -65,7 +65,11 @@
"appId": "im.riot.app",
"electronVersion": "7.1.3",
"files": [
"node_modules/**",
"package.json",
{
"from": ".hak/hakModules",
"to": "node_modules"
},
"src/**"
],
"extraResources": [

View File

@ -105,7 +105,15 @@ async function fetch(hakEnv, moduleInfo) {
});
// also extract another copy to the output directory at this point
// nb. we do not yarn install in the output copy
// nb. we do not yarn install in the output copy: we could install in
// production mode to get only runtime dependencies and not devDependencies,
// but usually native modules come with dependencies that are needed for
// building/fetching the native modules (eg. node-pre-gyp) rather than
// actually used at runtime: we do not want to bundle these into our app.
// We therefore just install no dependencies at all, and accept that any
// actual runtime dependencies will have to be added to the main app's
// dependencies. We can't tell what dependencies are real runtime deps
// and which are just used for native module building.
await mkdirp(moduleInfo.moduleOutDir);
await tar.x({
file: tarballFile,

View File

@ -76,7 +76,7 @@ async function main() {
moduleHakDir: path.join(prefix, 'hak', dep),
moduleDotHakDir: path.join(hakEnv.dotHakDir, dep),
moduleBuildDir: path.join(hakEnv.dotHakDir, dep, 'build'),
moduleOutDir: path.join(hakEnv.dotHakDir, dep, 'out'),
moduleOutDir: path.join(hakEnv.dotHakDir, 'hakModules', dep),
nodeModuleBinDir: path.join(hakEnv.dotHakDir, dep, 'build', 'node_modules', '.bin'),
depPrefix: path.join(hakEnv.dotHakDir, dep, 'opt'),
scripts: {},