Core: Use named exports in src/

The `default` export is treated differently across tooling when transpiled
to CommonJS - tools differ on whether `module.exports` represents the full
module object or just its default export. Switch `src/` modules to named
exports for tooling consistency.

Fixes gh-5262
Closes gh-5292
This commit is contained in:
Michał Gołębiowski-Owczarek
2023-09-12 02:27:19 +02:00
committed by GitHub
parent 42e50f8c21
commit f75daab091
136 changed files with 424 additions and 478 deletions

View File

@@ -221,7 +221,7 @@ module.exports = function( grunt ) {
// Remove the jQuery export from the entry file, we'll use our own
// custom wrapper.
setOverride( inputRollupOptions.input,
read( inputFileName ).replace( /\n*export default jQuery;\n*/, "\n" ) );
read( inputFileName ).replace( /\n*export \{ jQuery, jQuery as \$ };\n*/, "\n" ) );
// Replace exports/global with a noop noConflict
if ( excluded.includes( "exports/global" ) ) {