@docusaurus/faster 3.10.1-canary-6624 → 3.10.1-canary-6628
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.
- package/lib/index.d.ts +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +7 -3
- package/lib/index.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +9 -3
package/lib/index.d.ts
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { rspack as Rspack } from '@rspack/core';
|
|
8
8
|
import * as lightningcss from 'lightningcss';
|
|
9
|
-
import { minify as swcHtmlMinifier } from '@swc/html';
|
|
10
9
|
import type { JsMinifyOptions, Options as SwcOptions } from '@swc/core';
|
|
11
10
|
import type { CurrentBundler } from '@docusaurus/types';
|
|
12
11
|
export declare const swcLoader: string;
|
|
@@ -15,7 +14,8 @@ export declare const getSwcLoaderOptions: ({ isServer, bundlerName, }: {
|
|
|
15
14
|
bundlerName: CurrentBundler["name"];
|
|
16
15
|
}) => SwcOptions;
|
|
17
16
|
export declare const rspack: typeof Rspack;
|
|
18
|
-
|
|
17
|
+
type SwcHtmlMinifier = (typeof import('@swc/html'))['minify'];
|
|
18
|
+
export declare function getSwcHtmlMinifier(): Promise<SwcHtmlMinifier>;
|
|
19
19
|
export declare function getSwcJsMinimizerOptions(): JsMinifyOptions;
|
|
20
20
|
export declare function getBrowserslistQueries({ isServer, bundlerName, }: {
|
|
21
21
|
isServer: boolean;
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,IAAI,MAAM,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,YAAY,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAC,MAAM,IAAI,MAAM,EAAC,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,YAAY,MAAM,cAAc,CAAC;AAG7C,OAAO,KAAK,EAAC,eAAe,EAAE,OAAO,IAAI,UAAU,EAAC,MAAM,WAAW,CAAC;AACtE,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,SAAS,QAAgC,CAAC;AAEvD,eAAO,MAAM,mBAAmB,GAAI,4BAGjC;IACD,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;CACrC,KAAG,UAiBH,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,OAAO,MAAe,CAAC;AAE5C,KAAK,eAAe,GAAG,CAAC,cAAc,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AAM9D,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,eAAe,CAAC,CAGnE;AAMD,wBAAgB,wBAAwB,IAAI,eAAe,CAe1D;AAuBD,wBAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,WAAW,GACZ,EAAE;IACD,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;CACrC,GAAG,MAAM,EAAE,CAqBX;AAKD,KAAK,4BAA4B,GAAG,IAAI,CACtC,YAAY,CAAC,gBAAgB,CAAC,KAAK,CAAC,EACpC,UAAU,GAAG,MAAM,CACpB,CAAC;AAEF,wBAAgB,+BAA+B,IAAI,4BAA4B,CAG9E"}
|
package/lib/index.js
CHANGED
|
@@ -15,7 +15,6 @@ const tslib_1 = require("tslib");
|
|
|
15
15
|
const core_1 = require("@rspack/core");
|
|
16
16
|
const lightningcss = tslib_1.__importStar(require("lightningcss"));
|
|
17
17
|
const browserslist_1 = tslib_1.__importDefault(require("browserslist"));
|
|
18
|
-
const html_1 = require("@swc/html");
|
|
19
18
|
const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
20
19
|
exports.swcLoader = require.resolve('swc-loader');
|
|
21
20
|
const getSwcLoaderOptions = ({ isServer, bundlerName, }) => {
|
|
@@ -38,8 +37,13 @@ const getSwcLoaderOptions = ({ isServer, bundlerName, }) => {
|
|
|
38
37
|
};
|
|
39
38
|
exports.getSwcLoaderOptions = getSwcLoaderOptions;
|
|
40
39
|
exports.rspack = core_1.rspack;
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
// Import it lazily: not need for the dev server, more performant
|
|
41
|
+
// This also temporarily fix our StackBlitz playground
|
|
42
|
+
// See https://github.com/facebook/docusaurus/issues/12008
|
|
43
|
+
// See https://github.com/swc-project/swc/issues/11833
|
|
44
|
+
async function getSwcHtmlMinifier() {
|
|
45
|
+
const { minify } = await import('@swc/html');
|
|
46
|
+
return minify;
|
|
43
47
|
}
|
|
44
48
|
// Note: these options are similar to what we use in core
|
|
45
49
|
// They should rather be kept in sync for now to avoid any unexpected behavior
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AA4CH,gDAGC;AAMD,4DAeC;AAuBD,wDA2BC;AAUD,0EAGC;;AAjID,uCAA8C;AAC9C,mEAA6C;AAC7C,wEAAwC;AACxC,4DAA4B;AAIf,QAAA,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;AAEhD,MAAM,mBAAmB,GAAG,CAAC,EAClC,QAAQ,EACR,WAAW,GAIZ,EAAc,EAAE;IACf,OAAO;QACL,GAAG,EAAE;YACH,OAAO,EAAE,sBAAsB,CAAC,EAAC,QAAQ,EAAE,WAAW,EAAC,CAAC;SACzD;QACD,GAAG,EA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AE,CAAC;AACrC,CAAC;AAED,mEAAmE;AACnE,2DAA2D;AAC3D,SAAgB,sBAAsB,CAAC,EACrC,QAAQ,EACR,WAAW,GAIZ;IACC,IAAI,QAAQ,EAAE,CAAC;QACb,4BAA4B;QAC5B,IAAI,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,CAAC;YAC9C,OAAO,CAAC,QAAQ,OAAO,CAAC,GAAG,CAAC,6BAA6B,EAAE,CAAC,CAAC;QAC/D,CAAC;QACD,uEAAuE;QACvE,sEAAsE;QACtE,MAAM,UAAU,GAAG,aAAa,CAC9B,OAAO,CAAC,QAAQ,CAAC,IAAI,EACrB,mCAAmC,CAAC,WAAW,CAAC,CACjD,CAAC;QAEF,OAAO,CAAC,QAAQ,UAAU,EAAE,CAAC,CAAC;IAChC,CAAC;IAED,MAAM,OAAO,GAAG,sBAAY,CAAC,UAAU,CAAC,EAAC,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,EAAC,CAAC,IAAI;QAChE,GAAG,sBAAY,CAAC,QAAQ;KACzB,CAAC;IAEF,OAAO,OAAO,CAAC;AACjB,CAAC;AAUD,SAAgB,+BAA+B;IAC7C,MAAM,OAAO,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC/B,OAAO,EAAC,OAAO,EAAE,YAAY,CAAC,qBAAqB,CAAC,OAAO,CAAC,EAAC,CAAC;AAChE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/faster",
|
|
3
|
-
"version": "3.10.1-canary-
|
|
3
|
+
"version": "3.10.1-canary-6628",
|
|
4
4
|
"description": "Docusaurus experimental package exposing new modern dependencies to make the build faster.",
|
|
5
5
|
"main": "./lib/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@docusaurus/types": "3.10.1-canary-
|
|
21
|
+
"@docusaurus/types": "3.10.1-canary-6628",
|
|
22
22
|
"@rspack/core": "^1.7.10",
|
|
23
23
|
"@swc/core": "^1.15.32",
|
|
24
24
|
"@swc/html": "^1.15.32",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"peerDependencies": {
|
|
36
36
|
"@docusaurus/types": "*"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "92057cdd7a96e282d6362b39c3a6fd3ebaddcbe1"
|
|
39
39
|
}
|
package/src/index.ts
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
import {rspack as Rspack} from '@rspack/core';
|
|
9
9
|
import * as lightningcss from 'lightningcss';
|
|
10
10
|
import browserslist from 'browserslist';
|
|
11
|
-
import {minify as swcHtmlMinifier} from '@swc/html';
|
|
12
11
|
import semver from 'semver';
|
|
13
12
|
import type {JsMinifyOptions, Options as SwcOptions} from '@swc/core';
|
|
14
13
|
import type {CurrentBundler} from '@docusaurus/types';
|
|
@@ -42,8 +41,15 @@ export const getSwcLoaderOptions = ({
|
|
|
42
41
|
|
|
43
42
|
export const rspack: typeof Rspack = Rspack;
|
|
44
43
|
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
type SwcHtmlMinifier = (typeof import('@swc/html'))['minify'];
|
|
45
|
+
|
|
46
|
+
// Import it lazily: not need for the dev server, more performant
|
|
47
|
+
// This also temporarily fix our StackBlitz playground
|
|
48
|
+
// See https://github.com/facebook/docusaurus/issues/12008
|
|
49
|
+
// See https://github.com/swc-project/swc/issues/11833
|
|
50
|
+
export async function getSwcHtmlMinifier(): Promise<SwcHtmlMinifier> {
|
|
51
|
+
const {minify} = await import('@swc/html');
|
|
52
|
+
return minify;
|
|
47
53
|
}
|
|
48
54
|
|
|
49
55
|
// Note: these options are similar to what we use in core
|