@docusaurus/faster 4.0.0-canary-6898 → 4.0.0-canary-6901
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 +1 -5
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +0 -30
- package/lib/index.js.map +1 -1
- package/package.json +3 -4
- package/src/index.ts +1 -33
package/lib/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
import { RspackDevServer } from '@rspack/dev-server';
|
|
8
|
-
import type {
|
|
8
|
+
import type { Options as SwcOptions } from '@swc/core';
|
|
9
9
|
import type { CurrentBundler } from '@docusaurus/types';
|
|
10
10
|
export declare const getSwcLoaderOptions: ({ isServer, bundlerName, clientBrowserslistQueries, }: {
|
|
11
11
|
isServer: boolean;
|
|
@@ -17,8 +17,4 @@ export declare const rspack: typeof import("../node_modules/@rspack/core/dist/rs
|
|
|
17
17
|
webpack: typeof import("../node_modules/@rspack/core/dist/rspack.js", { with: { "resolution-mode": "import" } }).rspack & typeof import("../node_modules/@rspack/core/dist/exports.js", { with: { "resolution-mode": "import" } }) & /*elided*/ any;
|
|
18
18
|
};
|
|
19
19
|
export declare const rspackDevServer: typeof RspackDevServer;
|
|
20
|
-
type SwcHtmlMinifier = (typeof import('@swc/html'))['minify'];
|
|
21
|
-
export declare function getSwcHtmlMinifier(): Promise<SwcHtmlMinifier>;
|
|
22
|
-
export declare function getSwcJsMinimizerOptions(): JsMinifyOptions;
|
|
23
|
-
export {};
|
|
24
20
|
//# sourceMappingURL=index.d.ts.map
|
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;AAGH,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AAGnD,OAAO,KAAK,EAAC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AAGnD,OAAO,KAAK,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,WAAW,CAAC;AACrD,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,mBAAmB,CAAC;AAEtD,eAAO,MAAM,mBAAmB,0DAI7B;IACD,QAAQ,EAAE,OAAO,CAAC;IAClB,WAAW,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACpC,yBAAyB,EAAE,MAAM,EAAE,CAAC;CACrC,KAAG,UAwBH,CAAC;AAEF,eAAO,MAAM,MAAM;;;CAAS,CAAC;AAE7B,eAAO,MAAM,eAAe,wBAAkB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.rspackDevServer = exports.rspack = exports.getSwcLoaderOptions = void 0;
|
|
10
|
-
exports.getSwcHtmlMinifier = getSwcHtmlMinifier;
|
|
11
|
-
exports.getSwcJsMinimizerOptions = getSwcJsMinimizerOptions;
|
|
12
10
|
const tslib_1 = require("tslib");
|
|
13
11
|
const core_1 = require("@rspack/core");
|
|
14
12
|
const dev_server_1 = require("@rspack/dev-server");
|
|
@@ -42,34 +40,6 @@ const getSwcLoaderOptions = ({ isServer, bundlerName, clientBrowserslistQueries,
|
|
|
42
40
|
exports.getSwcLoaderOptions = getSwcLoaderOptions;
|
|
43
41
|
exports.rspack = core_1.rspack;
|
|
44
42
|
exports.rspackDevServer = dev_server_1.RspackDevServer;
|
|
45
|
-
// Import it lazily: not need for the dev server, more performant
|
|
46
|
-
// This also temporarily fix our StackBlitz playground
|
|
47
|
-
// See https://github.com/facebook/docusaurus/issues/12008
|
|
48
|
-
// See https://github.com/swc-project/swc/issues/11833
|
|
49
|
-
async function getSwcHtmlMinifier() {
|
|
50
|
-
const { minify } = await import('@swc/html');
|
|
51
|
-
return minify;
|
|
52
|
-
}
|
|
53
|
-
// Note: these options are similar to what we use in core
|
|
54
|
-
// They should rather be kept in sync for now to avoid any unexpected behavior
|
|
55
|
-
// The goal of faster minifier is not to fine-tune options but only to be faster
|
|
56
|
-
// See core minification.ts
|
|
57
|
-
function getSwcJsMinimizerOptions() {
|
|
58
|
-
return {
|
|
59
|
-
ecma: 2020,
|
|
60
|
-
compress: {
|
|
61
|
-
ecma: 5,
|
|
62
|
-
},
|
|
63
|
-
module: true,
|
|
64
|
-
mangle: true,
|
|
65
|
-
safari10: true,
|
|
66
|
-
format: {
|
|
67
|
-
ecma: 5,
|
|
68
|
-
comments: false,
|
|
69
|
-
ascii_only: true,
|
|
70
|
-
},
|
|
71
|
-
};
|
|
72
|
-
}
|
|
73
43
|
// TODO this is not accurate
|
|
74
44
|
// for Rspack we should read from the built-in browserslist data
|
|
75
45
|
// see https://github.com/facebook/docusaurus/pull/11496
|
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;;;;AAEH,uCAA8C;AAC9C,mDAAmD;AACnD,wEAAwC;AACxC,4DAA4B;AAIrB,MAAM,mBAAmB,GAAG,CAAC,EAClC,QAAQ,EACR,WAAW,EACX,yBAAyB,GAK1B,EAAc,EAAE;IACf,OAAO;QACL,GAAG,EAAE;YACH,OAAO,EAAE,QAAQ;gBACf,CAAC,CAAC,4BAA4B,CAAC,EAAC,WAAW,EAAC,CAAC;gBAC7C,CAAC,CAAC,yBAAyB;SAC9B;QACD,GAAG,EAAE;YACH,MAAM,EAAE;gBACN,MAAM,EAAE,YAAY;gBACpB,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1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@docusaurus/faster",
|
|
3
|
-
"version": "4.0.0-canary-
|
|
3
|
+
"version": "4.0.0-canary-6901",
|
|
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,11 +18,10 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@docusaurus/types": "4.0.0-canary-
|
|
21
|
+
"@docusaurus/types": "4.0.0-canary-6901",
|
|
22
22
|
"@rspack/core": "^2.2.3",
|
|
23
23
|
"@rspack/dev-server": "^2.2.1",
|
|
24
24
|
"@swc/core": "^1.16.2",
|
|
25
|
-
"@swc/html": "^1.16.2",
|
|
26
25
|
"browserslist": "^4.29.0",
|
|
27
26
|
"semver": "^7.8.5",
|
|
28
27
|
"tslib": "^2.8.1"
|
|
@@ -33,5 +32,5 @@
|
|
|
33
32
|
"peerDependencies": {
|
|
34
33
|
"@docusaurus/types": "*"
|
|
35
34
|
},
|
|
36
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "684637ddf6b3cb641475d5e5437078d9fa6d37fc"
|
|
37
36
|
}
|
package/src/index.ts
CHANGED
|
@@ -9,7 +9,7 @@ import {rspack as Rspack} from '@rspack/core';
|
|
|
9
9
|
import {RspackDevServer} from '@rspack/dev-server';
|
|
10
10
|
import browserslist from 'browserslist';
|
|
11
11
|
import semver from 'semver';
|
|
12
|
-
import type {
|
|
12
|
+
import type {Options as SwcOptions} from '@swc/core';
|
|
13
13
|
import type {CurrentBundler} from '@docusaurus/types';
|
|
14
14
|
|
|
15
15
|
export const getSwcLoaderOptions = ({
|
|
@@ -50,38 +50,6 @@ export const rspack = Rspack;
|
|
|
50
50
|
|
|
51
51
|
export const rspackDevServer = RspackDevServer;
|
|
52
52
|
|
|
53
|
-
type SwcHtmlMinifier = (typeof import('@swc/html'))['minify'];
|
|
54
|
-
|
|
55
|
-
// Import it lazily: not need for the dev server, more performant
|
|
56
|
-
// This also temporarily fix our StackBlitz playground
|
|
57
|
-
// See https://github.com/facebook/docusaurus/issues/12008
|
|
58
|
-
// See https://github.com/swc-project/swc/issues/11833
|
|
59
|
-
export async function getSwcHtmlMinifier(): Promise<SwcHtmlMinifier> {
|
|
60
|
-
const {minify} = await import('@swc/html');
|
|
61
|
-
return minify;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Note: these options are similar to what we use in core
|
|
65
|
-
// They should rather be kept in sync for now to avoid any unexpected behavior
|
|
66
|
-
// The goal of faster minifier is not to fine-tune options but only to be faster
|
|
67
|
-
// See core minification.ts
|
|
68
|
-
export function getSwcJsMinimizerOptions(): JsMinifyOptions {
|
|
69
|
-
return {
|
|
70
|
-
ecma: 2020,
|
|
71
|
-
compress: {
|
|
72
|
-
ecma: 5,
|
|
73
|
-
},
|
|
74
|
-
module: true,
|
|
75
|
-
mangle: true,
|
|
76
|
-
safari10: true,
|
|
77
|
-
format: {
|
|
78
|
-
ecma: 5,
|
|
79
|
-
comments: false,
|
|
80
|
-
ascii_only: true,
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
}
|
|
84
|
-
|
|
85
53
|
// TODO this is not accurate
|
|
86
54
|
// for Rspack we should read from the built-in browserslist data
|
|
87
55
|
// see https://github.com/facebook/docusaurus/pull/11496
|