Files
etcher/beforeBuild.js
Alexis Svinartchouk 81b5c67a3b Fix beforeBuild.js script to also work on mac
Change-type: patch
2021-02-16 15:49:18 +01:00

27 lines
745 B
JavaScript

'use strict'
const cp = require('child_process');
const rimraf = require('rimraf');
const process = require('process');
// Rebuild native modules for ia32 and run webpack again for the ia32 part of windows packages
exports.default = function(context) {
if (['windows', 'mac'].includes(context.platform.name)) {
cp.execFileSync(
'npx',
['electron-rebuild', '--types', 'dev', '--arch', context.arch],
);
rimraf.sync('generated');
cp.execFileSync(
'npx',
['webpack'],
{
env: {
...process.env,
npm_config_target_arch: context.arch,
},
},
);
}
}