dbgate/fillNativeModules.js

24 lines
681 B
JavaScript
Raw Normal View History

2021-01-17 08:11:09 +00:00
const fs = require('fs');
let fillContent = '';
if (process.platform == 'win32') {
fillContent += `content.msnodesqlv8 = () => require('msnodesqlv8');`;
}
2021-05-13 06:41:45 +00:00
fillContent += `content['better-sqlite3-with-prebuilds'] = () => require('better-sqlite3-with-prebuilds');`;
2021-01-17 08:11:09 +00:00
const getContent = (empty) => `
// this file is generated automatically by script fillNativeModules.js, do not edit it manually
const content = {};
${empty ? '' : fillContent}
module.exports = content;
`;
fs.writeFileSync(
'packages/api/src/nativeModulesContent.js',
getContent(process.argv.includes('--electron') ? true : false)
);
fs.writeFileSync('app/src/nativeModulesContent.js', getContent(false));