build: drop @types/webpack-env in favor of webpack/module types (#47798)

* build: drop @types/webpack-env in favor of webpack/module types

* chore: improve type when assigning to global.require
This commit is contained in:
David Sanders 2025-08-08 18:09:23 -07:00 committed by GitHub
commit a201d6c541
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 24 additions and 25 deletions

View file

@ -204,7 +204,7 @@ delete process.appCodeLoaded;
if (packagePath) {
// Finally load app's main.js and transfer control to C++.
if ((packageJson.type === 'module' && !mainStartupScript.endsWith('.cjs')) || mainStartupScript.endsWith('.mjs')) {
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');
const main = (require('url') as typeof url).pathToFileURL(path.join(packagePath, mainStartupScript));
runEntryPointWithESMLoader(async (cascadedLoader: any) => {
try {