@docusaurus/bundler 3.6.0 → 3.6.1
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,CAyBhD"}
|
package/lib/loaders/jsLoader.js
CHANGED
|
@@ -43,22 +43,21 @@ async function createRspackSwcJsLoaderFactory() {
|
|
|
43
43
|
async function createJsLoaderFactory({ siteConfig, }) {
|
|
44
44
|
const currentBundler = await (0, currentBundler_1.getCurrentBundler)({ siteConfig });
|
|
45
45
|
const isSWCLoader = siteConfig.future.experimental_faster.swcJsLoader;
|
|
46
|
-
if (
|
|
47
|
-
|
|
46
|
+
if (isSWCLoader) {
|
|
47
|
+
if (siteConfig.webpack?.jsLoader) {
|
|
48
|
+
throw new Error(`You can't use siteConfig.webpack.jsLoader and siteConfig.future.experimental_faster.swcJsLoader at the same time.
|
|
49
|
+
To avoid any configuration ambiguity, you must make an explicit choice:
|
|
50
|
+
- If you want to use Docusaurus Faster and SWC (recommended), remove siteConfig.webpack.jsLoader
|
|
51
|
+
- If you want to use a custom JS loader, use siteConfig.future.experimental_faster.swcJsLoader: false`);
|
|
52
|
+
}
|
|
53
|
+
return currentBundler.name === 'rspack'
|
|
48
54
|
? createRspackSwcJsLoaderFactory()
|
|
49
|
-
:
|
|
55
|
+
: createSwcJsLoaderFactory();
|
|
50
56
|
}
|
|
51
57
|
const jsLoader = siteConfig.webpack?.jsLoader ?? 'babel';
|
|
52
|
-
if (jsLoader instanceof Function &&
|
|
53
|
-
siteConfig.future?.experimental_faster.swcJsLoader) {
|
|
54
|
-
throw new Error("You can't use a custom webpack.jsLoader and experimental_faster.swcJsLoader at the same time");
|
|
55
|
-
}
|
|
56
58
|
if (jsLoader instanceof Function) {
|
|
57
59
|
return ({ isServer }) => jsLoader(isServer);
|
|
58
60
|
}
|
|
59
|
-
if (siteConfig.future?.experimental_faster.swcJsLoader) {
|
|
60
|
-
return createSwcJsLoaderFactory();
|
|
61
|
-
}
|
|
62
61
|
if (jsLoader === 'babel') {
|
|
63
62
|
return BabelJsLoaderFactory;
|
|
64
63
|
}
|
|
@@ -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":[],"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AI,UAAU,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;YACjC,MAAM,IAAI,KAAK,CACb;;;sGAG8F,CAC/F,CAAC;QACJ,CAAC;QACD,OAAO,cAAc,CAAC,IAAI,KAAK,QAAQ;YACrC,CAAC,CAAC,8BAA8B,EAAE;YAClC,CAAC,CAAC,wBAAwB,EAAE,CAAC;IACjC,CAAC;IAED,MAAM,QAAQ,GAAG,UAAU,CAAC,OAAO,EAAE,QAAQ,IAAI,OAAO,CAAC;IACzD,IAAI,QAAQ,YAAY,QAAQ,EAAE,CAAC;QACjC,OAAO,CAAC,EAAC,QAAQ,EAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAC5C,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.6.
|
|
3
|
+
"version": "3.6.1",
|
|
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.6.
|
|
23
|
-
"@docusaurus/cssnano-preset": "3.6.
|
|
24
|
-
"@docusaurus/logger": "3.6.
|
|
25
|
-
"@docusaurus/types": "3.6.
|
|
26
|
-
"@docusaurus/utils": "3.6.
|
|
22
|
+
"@docusaurus/babel": "3.6.1",
|
|
23
|
+
"@docusaurus/cssnano-preset": "3.6.1",
|
|
24
|
+
"@docusaurus/logger": "3.6.1",
|
|
25
|
+
"@docusaurus/types": "3.6.1",
|
|
26
|
+
"@docusaurus/utils": "3.6.1",
|
|
27
27
|
"autoprefixer": "^10.4.14",
|
|
28
28
|
"babel-loader": "^9.2.1",
|
|
29
29
|
"clean-css": "^5.3.2",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"webpackbar": "^6.0.1"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@docusaurus/faster": "
|
|
48
|
+
"@docusaurus/faster": "*"
|
|
49
49
|
},
|
|
50
50
|
"peerDependenciesMeta": {
|
|
51
51
|
"@docusaurus/faster": {
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"engines": {
|
|
59
59
|
"node": ">=18.0"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "c971734bb55f4e7c2d1c679b41dcbeb6f2a6c8ad"
|
|
62
62
|
}
|
package/src/loaders/jsLoader.ts
CHANGED
|
@@ -62,26 +62,24 @@ 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
|
-
if (
|
|
66
|
-
|
|
65
|
+
if (isSWCLoader) {
|
|
66
|
+
if (siteConfig.webpack?.jsLoader) {
|
|
67
|
+
throw new Error(
|
|
68
|
+
`You can't use siteConfig.webpack.jsLoader and siteConfig.future.experimental_faster.swcJsLoader at the same time.
|
|
69
|
+
To avoid any configuration ambiguity, you must make an explicit choice:
|
|
70
|
+
- If you want to use Docusaurus Faster and SWC (recommended), remove siteConfig.webpack.jsLoader
|
|
71
|
+
- If you want to use a custom JS loader, use siteConfig.future.experimental_faster.swcJsLoader: false`,
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
return currentBundler.name === 'rspack'
|
|
67
75
|
? createRspackSwcJsLoaderFactory()
|
|
68
|
-
:
|
|
76
|
+
: createSwcJsLoaderFactory();
|
|
69
77
|
}
|
|
78
|
+
|
|
70
79
|
const jsLoader = siteConfig.webpack?.jsLoader ?? 'babel';
|
|
71
|
-
if (
|
|
72
|
-
jsLoader instanceof Function &&
|
|
73
|
-
siteConfig.future?.experimental_faster.swcJsLoader
|
|
74
|
-
) {
|
|
75
|
-
throw new Error(
|
|
76
|
-
"You can't use a custom webpack.jsLoader and experimental_faster.swcJsLoader at the same time",
|
|
77
|
-
);
|
|
78
|
-
}
|
|
79
80
|
if (jsLoader instanceof Function) {
|
|
80
81
|
return ({isServer}) => jsLoader(isServer);
|
|
81
82
|
}
|
|
82
|
-
if (siteConfig.future?.experimental_faster.swcJsLoader) {
|
|
83
|
-
return createSwcJsLoaderFactory();
|
|
84
|
-
}
|
|
85
83
|
if (jsLoader === 'babel') {
|
|
86
84
|
return BabelJsLoaderFactory;
|
|
87
85
|
}
|