Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf75daab

Browse files
authored
Core: Use named exports insrc/
The `default` export is treated differently across tooling when transpiledto CommonJS - tools differ on whether `module.exports` represents the fullmodule object or just its default export. Switch `src/` modules to namedexports for tooling consistency.Fixesgh-5262Closesgh-5292
1 parent42e50f8 commitf75daab

File tree

136 files changed

+424
-478
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+424
-478
lines changed

‎build/tasks/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ module.exports = function( grunt ) {
221221
// Remove the jQuery export from the entry file, we'll use our own
222222
// custom wrapper.
223223
setOverride(inputRollupOptions.input,
224-
read(inputFileName).replace(/\n*exportdefaultjQuery;\n*/,"\n"));
224+
read(inputFileName).replace(/\n*export\{jQuery,jQueryas\$};\n*/,"\n"));
225225

226226
// Replace exports/global with a noop noConflict
227227
if(excluded.includes("exports/global")){

‎src/ajax.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
importjQueryfrom"./core.js";
2-
importdocumentfrom"./var/document.js";
3-
importrnothtmlwhitefrom"./var/rnothtmlwhite.js";
4-
importlocationfrom"./ajax/var/location.js";
5-
importnoncefrom"./ajax/var/nonce.js";
6-
importrqueryfrom"./ajax/var/rquery.js";
1+
import{jQuery}from"./core.js";
2+
import{document}from"./var/document.js";
3+
import{rnothtmlwhite}from"./var/rnothtmlwhite.js";
4+
import{location}from"./ajax/var/location.js";
5+
import{nonce}from"./ajax/var/nonce.js";
6+
import{rquery}from"./ajax/var/rquery.js";
77

88
import"./core/init.js";
99
import"./core/parseXML.js";
@@ -874,4 +874,4 @@ jQuery.ajaxPrefilter( function( s ) {
874874
}
875875
});
876876

877-
exportdefaultjQuery;
877+
export{jQuery,jQueryas$};

‎src/ajax/binary.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
importjQueryfrom"../core.js";
1+
import{jQuery}from"../core.js";
22

33
import"../ajax.js";
44

‎src/ajax/jsonp.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
importjQueryfrom"../core.js";
2-
importnoncefrom"./var/nonce.js";
3-
importrqueryfrom"./var/rquery.js";
1+
import{jQuery}from"../core.js";
2+
import{nonce}from"./var/nonce.js";
3+
import{rquery}from"./var/rquery.js";
44

55
import"../ajax.js";
66

‎src/ajax/load.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
importjQueryfrom"../core.js";
2-
importstripAndCollapsefrom"../core/stripAndCollapse.js";
1+
import{jQuery}from"../core.js";
2+
import{stripAndCollapse}from"../core/stripAndCollapse.js";
33

44
import"../core/parseHTML.js";
55
import"../ajax.js";

‎src/ajax/script.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
importjQueryfrom"../core.js";
2-
importdocumentfrom"../var/document.js";
1+
import{jQuery}from"../core.js";
2+
import{document}from"../var/document.js";
33

44
import"../ajax.js";
55

‎src/ajax/var/location.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
exportdefaultwindow.location;
1+
exportvarlocation=window.location;

‎src/ajax/var/nonce.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
exportdefault{guid:Date.now()};
1+
exportvarnonce={guid:Date.now()};

‎src/ajax/var/rquery.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
exportdefault(/\?/);
1+
exportvarrquery=/\?/;

‎src/ajax/xhr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
importjQueryfrom"../core.js";
1+
import{jQuery}from"../core.js";
22

33
import"../ajax.js";
44

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp