dbgate/fillNativeModules.js

25 lines
722 B
JavaScript
Raw Permalink Normal View History

2021-01-17 08:11:09 +00:00
const fs = require('fs');
let fillContent = '';
if (process.platform == 'win32') {
2024-07-31 09:20:31 +00:00
fillContent += `content.msnodesqlv8 = () => require('msnodesqlv8');\n`;
2021-01-17 08:11:09 +00:00
}
2024-07-31 09:20:31 +00:00
fillContent += `content['better-sqlite3'] = () => require('better-sqlite3');\n`;
fillContent += `content['oracledb'] = () => require('oracledb');\n`;
2021-01-17 08:11:09 +00:00
2022-11-20 16:03:55 +00:00
const getContent = empty => `
2021-01-17 08:11:09 +00:00
// 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));