[RequireNative] Remove and just use require to simplify

This commit is contained in:
Ducko 2022-02-11 08:43:44 +00:00
parent 0abad98295
commit 75d5cf0915
3 changed files with 2 additions and 7 deletions

4
src/bootstrap.js vendored
View file

@ -20,8 +20,6 @@ switch (process.platform) { // Discord forces these
app.name = 'discord'; // Force name as sometimes breaks app.name = 'discord'; // Force name as sometimes breaks
app.allowRendererProcessReuse = false; app.allowRendererProcessReuse = false;
const requireNative = require('./utils/requireNative');
const paths = require('./paths'); const paths = require('./paths');
global.moduleDataPath = paths.getModuleDataPath(); // Global because discord global.moduleDataPath = paths.getModuleDataPath(); // Global because discord
app.setPath('userData', paths.getUserData()); // Set userData properly because electron app.setPath('userData', paths.getUserData()); // Set userData properly because electron
@ -51,7 +49,7 @@ if (!settings.get('enableHardwareAcceleration', true)) app.disableHardwareAccele
let desktopCore; let desktopCore;
const startCore = () => { const startCore = () => {
desktopCore = requireNative('discord_desktop_core'); desktopCore = require('discord_desktop_core');
log('Bootstrap', 'Required desktop_core:', desktopCore); log('Bootstrap', 'Required desktop_core:', desktopCore);
desktopCore.startup({ desktopCore.startup({

View file

@ -31,7 +31,7 @@ if (process.argv.includes('--overlay-host')) {
require('./updater/moduleUpdater').initPathsOnly(buildInfo); require('./updater/moduleUpdater').initPathsOnly(buildInfo);
} }
require('./utils/requireNative')('discord_overlay2/standalone_host.js') require('discord_overlay2/standalone_host.js')
} else { } else {
const bootstrap = require('./bootstrap'); const bootstrap = require('./bootstrap');

View file

@ -1,3 +0,0 @@
// From Discord to only require native modules like discord_desktop_core
module.paths = [];
module.exports = require;