build: drop @types/webpack-env in favor of webpack/module types (#48047)
* build: drop @types/webpack-env in favor of webpack/module types * chore: improve type when assigning to global.require
This commit is contained in:
parent
f4e6a361de
commit
116c24aaf2
10 changed files with 24 additions and 25 deletions
|
@ -65,9 +65,9 @@ require('@electron/internal/renderer/common-init');
|
|||
|
||||
if (nodeIntegration) {
|
||||
// Export node bindings to global.
|
||||
const { makeRequireFunction } = __non_webpack_require__('internal/modules/helpers');
|
||||
const { makeRequireFunction } = __non_webpack_require__('internal/modules/helpers') as typeof import('@node/lib/internal/modules/helpers');
|
||||
global.module = new Module('electron/js2c/renderer_init');
|
||||
global.require = makeRequireFunction(global.module);
|
||||
global.require = makeRequireFunction(global.module) as NodeRequire;
|
||||
|
||||
// Set the __filename to the path of html file if it is file: protocol.
|
||||
if (window.location.protocol === 'file:') {
|
||||
|
@ -150,7 +150,7 @@ if (cjsPreloads.length) {
|
|||
}
|
||||
}
|
||||
if (esmPreloads.length) {
|
||||
const { runEntryPointWithESMLoader } = __non_webpack_require__('internal/modules/run_main');
|
||||
const { runEntryPointWithESMLoader } = __non_webpack_require__('internal/modules/run_main') as typeof import('@node/lib/internal/modules/run_main');
|
||||
|
||||
runEntryPointWithESMLoader(async (cascadedLoader: any) => {
|
||||
// Load the preload scripts.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue