@docusaurus/bundler 3.5.2-canary-6124 → 3.5.2-canary-6127
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/jsLoader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAC,qBAAqB,EAAE,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AA0C/E,wBAAsB,qBAAqB,CAAC,EAC1C,UAAU,GACX,EAAE;IACD,UAAU,EAAE;QACV,OAAO,CAAC,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;QACtC,MAAM,EAAE;YACN,mBAAmB,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC,CAAC;SACxE,CAAC;KACH,CAAC;CACH,GAAG,OAAO,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"jsLoader.d.ts","sourceRoot":"","sources":["../../src/loaders/jsLoader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAC,qBAAqB,EAAE,gBAAgB,EAAC,MAAM,mBAAmB,CAAC;AA0C/E,wBAAsB,qBAAqB,CAAC,EAC1C,UAAU,GACX,EAAE;IACD,UAAU,EAAE;QACV,OAAO,CAAC,EAAE,gBAAgB,CAAC,SAAS,CAAC,CAAC;QACtC,MAAM,EAAE;YACN,mBAAmB,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC,qBAAqB,CAAC,CAAC;SACxE,CAAC;KACH,CAAC;CACH,GAAG,OAAO,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC,CA2BhD"}
|
package/lib/loaders/jsLoader.js
CHANGED
|
@@ -16,7 +16,7 @@ const BabelJsLoaderFactory = ({ isServer, babelOptions, }) => {
|
|
|
16
16
|
options: (0, babel_1.getBabelOptions)({ isServer, babelOptions }),
|
|
17
17
|
};
|
|
18
18
|
};
|
|
19
|
-
async function
|
|
19
|
+
async function createSwcJsLoaderFactory() {
|
|
20
20
|
const loader = await (0, importFaster_1.importSwcLoader)();
|
|
21
21
|
const getOptions = await (0, importFaster_1.importGetSwcLoaderOptions)();
|
|
22
22
|
return ({ isServer }) => {
|
|
@@ -27,7 +27,7 @@ async function createSwcLoaderFactory() {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
// Same as swcLoader, except we use the built-in SWC loader
|
|
30
|
-
async function
|
|
30
|
+
async function createRspackSwcJsLoaderFactory() {
|
|
31
31
|
const loader = 'builtin:swc-loader';
|
|
32
32
|
const getOptions = await (0, importFaster_1.importGetSwcLoaderOptions)();
|
|
33
33
|
return ({ isServer }) => {
|
|
@@ -44,10 +44,9 @@ async function createJsLoaderFactory({ siteConfig, }) {
|
|
|
44
44
|
const currentBundler = await (0, currentBundler_1.getCurrentBundler)({ siteConfig });
|
|
45
45
|
const isSWCLoader = siteConfig.future.experimental_faster.swcJsLoader;
|
|
46
46
|
if (currentBundler.name === 'rspack') {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return createRspackLoaderFactory();
|
|
47
|
+
return isSWCLoader
|
|
48
|
+
? createRspackSwcJsLoaderFactory()
|
|
49
|
+
: BabelJsLoaderFactory;
|
|
51
50
|
}
|
|
52
51
|
const jsLoader = siteConfig.webpack?.jsLoader ?? 'babel';
|
|
53
52
|
if (jsLoader instanceof Function &&
|
|
@@ -58,7 +57,7 @@ async function createJsLoaderFactory({ siteConfig, }) {
|
|
|
58
57
|
return ({ isServer }) => jsLoader(isServer);
|
|
59
58
|
}
|
|
60
59
|
if (siteConfig.future?.experimental_faster.swcJsLoader) {
|
|
61
|
-
return
|
|
60
|
+
return createSwcJsLoaderFactory();
|
|
62
61
|
}
|
|
63
62
|
if (jsLoader === 'babel') {
|
|
64
63
|
return BabelJsLoaderFactory;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsLoader.js","sourceRoot":"","sources":["../../src/loaders/jsLoader.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AA+CH,
|
|
1
|
+
{"version":3,"file":"jsLoader.js","sourceRoot":"","sources":["../../src/loaders/jsLoader.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AA+CH,sDAoCC;AAjFD,6CAAkD;AAClD,kDAA2E;AAC3E,sDAAoD;AAGpD,MAAM,oBAAoB,GAAyC,CAAC,EAClE,QAAQ,EACR,YAAY,GACb,EAAE,EAAE;IACH,OAAO;QACL,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC;QACvC,OAAO,EAAE,IAAA,uBAAe,EAAC,EAAC,QAAQ,EAAE,YAAY,EAAC,CAAC;KACnD,CAAC;AACJ,CAAC,CAAC;AAEF,KAAK,UAAU,wBAAwB;IAGrC,MAAM,MAAM,GAAG,MAAM,IAAA,8BAAe,GAAE,CAAC;IACvC,MAAM,UAAU,GAAG,MAAM,IAAA,wCAAyB,GAAE,CAAC;IACrD,OAAO,CAAC,EAAC,QAAQ,EAAC,EAAE,EAAE;QACpB,OAAO;YACL,MAAM;YACN,OAAO,EAAE,UAAU,CAAC,EAAC,QAAQ,EAAC,CAAC;SAChC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED,2DAA2D;AAC3D,KAAK,UAAU,8BAA8B;IAG3C,MAAM,MAAM,GAAG,oBAAoB,CAAC;IACpC,MAAM,UAAU,GAAG,MAAM,IAAA,wCAAyB,GAAE,CAAC;IACrD,OAAO,CAAC,EAAC,QAAQ,EAAC,EAAE,EAAE;QACpB,OAAO;YACL,MAAM;YACN,OAAO,EAAE,UAAU,CAAC,EAAC,QAAQ,EAAC,CAAC;SAChC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAED,6EAA6E;AAC7E,wEAAwE;AACxE,yEAAyE;AAClE,KAAK,UAAU,qBAAqB,CAAC,EAC1C,UAAU,GAQX;IACC,MAAM,cAAc,GAAG,MAAM,IAAA,kCAAiB,EAAC,EAAC,UAAU,EAAC,CAAC,CAAC;IAC7D,MAAM,WAAW,GAAG,UAAU,CAAC,MAAM,CAAC,mBAAmB,CAAC,WAAW,CAAC;IACtE,IAAI,cAAc,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;QACrC,OAAO,WAAW;YAChB,CAAC,CAAC,8BAA8B,EAAE;YAClC,CAAC,CAAC,oBAAoB,CAAC;IAC3B,CAAC;IACD,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,EAAE,QAAQ,IAAI,OAAO,CAAC;IACzD,IACE,QAAQ,YAAY,QAAQ;QAC5B,UAAU,CAAC,MAAM,EAAE,mBAAmB,CAAC,WAAW,EAClD,CAAC;QACD,MAAM,IAAI,KAAK,CACb,8FAA8F,CAC/F,CAAC;IACJ,CAAC;IACD,IAAI,QAAQ,YAAY,QAAQ,EAAE,CAAC;QACjC,OAAO,CAAC,EAAC,QAAQ,EAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;IACD,IAAI,UAAU,CAAC,MAAM,EAAE,mBAAmB,CAAC,WAAW,EAAE,CAAC;QACvD,OAAO,wBAAwB,EAAE,CAAC;IACpC,CAAC;IACD,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QACzB,OAAO,oBAAoB,CAAC;IAC9B,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,4CAA4C,QAAQ,EAAE,CAAC,CAAC;AAC1E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/bundler",
|
|
3
|
-
"version": "3.5.2-canary-
|
|
3
|
+
"version": "3.5.2-canary-6127",
|
|
4
4
|
"description": "Docusaurus util package to abstract the current bundler.",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@babel/core": "^7.25.9",
|
|
22
|
-
"@docusaurus/babel": "3.5.2-canary-
|
|
23
|
-
"@docusaurus/cssnano-preset": "3.5.2-canary-
|
|
24
|
-
"@docusaurus/logger": "3.5.2-canary-
|
|
25
|
-
"@docusaurus/types": "3.5.2-canary-
|
|
26
|
-
"@docusaurus/utils": "3.5.2-canary-
|
|
22
|
+
"@docusaurus/babel": "3.5.2-canary-6127",
|
|
23
|
+
"@docusaurus/cssnano-preset": "3.5.2-canary-6127",
|
|
24
|
+
"@docusaurus/logger": "3.5.2-canary-6127",
|
|
25
|
+
"@docusaurus/types": "3.5.2-canary-6127",
|
|
26
|
+
"@docusaurus/utils": "3.5.2-canary-6127",
|
|
27
27
|
"autoprefixer": "^10.4.14",
|
|
28
28
|
"babel-loader": "^9.2.1",
|
|
29
29
|
"clean-css": "^5.3.2",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">=18.0"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "9934a026caa06786a7905bc3840949e636b57e37"
|
|
62
62
|
}
|
package/src/loaders/jsLoader.ts
CHANGED
|
@@ -20,7 +20,7 @@ const BabelJsLoaderFactory: ConfigureWebpackUtils['getJSLoader'] = ({
|
|
|
20
20
|
};
|
|
21
21
|
};
|
|
22
22
|
|
|
23
|
-
async function
|
|
23
|
+
async function createSwcJsLoaderFactory(): Promise<
|
|
24
24
|
ConfigureWebpackUtils['getJSLoader']
|
|
25
25
|
> {
|
|
26
26
|
const loader = await importSwcLoader();
|
|
@@ -34,7 +34,7 @@ async function createSwcLoaderFactory(): Promise<
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// Same as swcLoader, except we use the built-in SWC loader
|
|
37
|
-
async function
|
|
37
|
+
async function createRspackSwcJsLoaderFactory(): Promise<
|
|
38
38
|
ConfigureWebpackUtils['getJSLoader']
|
|
39
39
|
> {
|
|
40
40
|
const loader = 'builtin:swc-loader';
|
|
@@ -62,14 +62,10 @@ export async function createJsLoaderFactory({
|
|
|
62
62
|
}): Promise<ConfigureWebpackUtils['getJSLoader']> {
|
|
63
63
|
const currentBundler = await getCurrentBundler({siteConfig});
|
|
64
64
|
const isSWCLoader = siteConfig.future.experimental_faster.swcJsLoader;
|
|
65
|
-
|
|
66
65
|
if (currentBundler.name === 'rspack') {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
return createRspackLoaderFactory();
|
|
66
|
+
return isSWCLoader
|
|
67
|
+
? createRspackSwcJsLoaderFactory()
|
|
68
|
+
: BabelJsLoaderFactory;
|
|
73
69
|
}
|
|
74
70
|
const jsLoader = siteConfig.webpack?.jsLoader ?? 'babel';
|
|
75
71
|
if (
|
|
@@ -84,7 +80,7 @@ export async function createJsLoaderFactory({
|
|
|
84
80
|
return ({isServer}) => jsLoader(isServer);
|
|
85
81
|
}
|
|
86
82
|
if (siteConfig.future?.experimental_faster.swcJsLoader) {
|
|
87
|
-
return
|
|
83
|
+
return createSwcJsLoaderFactory();
|
|
88
84
|
}
|
|
89
85
|
if (jsLoader === 'babel') {
|
|
90
86
|
return BabelJsLoaderFactory;
|