@docusaurus/faster 0.0.0-6098 → 0.0.0-6101
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 +3 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +12 -0
- package/lib/index.js.map +1 -1
- package/package.json +3 -2
- package/src/index.ts +12 -0
package/lib/index.d.ts
CHANGED
|
@@ -4,15 +4,18 @@
|
|
|
4
4
|
* This source code is licensed under the MIT license found in the
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
|
+
import Rspack from '@rspack/core';
|
|
7
8
|
import * as lightningcss from 'lightningcss';
|
|
8
9
|
import { minify as swcHtmlMinifier } from '@swc/html';
|
|
9
10
|
import type { RuleSetRule } from 'webpack';
|
|
10
11
|
import type { JsMinifyOptions } from '@swc/core';
|
|
12
|
+
export declare const rspack: typeof Rspack;
|
|
11
13
|
export declare function getSwcHtmlMinifier(): typeof swcHtmlMinifier;
|
|
12
14
|
export declare function getSwcJsLoaderFactory({ isServer, }: {
|
|
13
15
|
isServer: boolean;
|
|
14
16
|
}): RuleSetRule;
|
|
15
17
|
export declare function getSwcJsMinimizerOptions(): JsMinifyOptions;
|
|
18
|
+
export declare function getBrowserslistQueries(): string[];
|
|
16
19
|
type LightningCssMinimizerOptions = Omit<lightningcss.TransformOptions<never>, 'filename' | 'code'>;
|
|
17
20
|
export declare function getLightningCssMinimizerOptions(): LightningCssMinimizerOptions;
|
|
18
21
|
export {};
|
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,KAAK,YAAY,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAC,MAAM,IAAI,eAAe,EAAC,MAAM,WAAW,CAAC;AACpD,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,SAA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 +6,18 @@
|
|
|
6
6
|
* LICENSE file in the root directory of this source tree.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.rspack = void 0;
|
|
9
10
|
exports.getSwcHtmlMinifier = getSwcHtmlMinifier;
|
|
10
11
|
exports.getSwcJsLoaderFactory = getSwcJsLoaderFactory;
|
|
11
12
|
exports.getSwcJsMinimizerOptions = getSwcJsMinimizerOptions;
|
|
13
|
+
exports.getBrowserslistQueries = getBrowserslistQueries;
|
|
12
14
|
exports.getLightningCssMinimizerOptions = getLightningCssMinimizerOptions;
|
|
13
15
|
const tslib_1 = require("tslib");
|
|
16
|
+
const core_1 = tslib_1.__importDefault(require("@rspack/core"));
|
|
14
17
|
const lightningcss = tslib_1.__importStar(require("lightningcss"));
|
|
15
18
|
const browserslist_1 = tslib_1.__importDefault(require("browserslist"));
|
|
16
19
|
const html_1 = require("@swc/html");
|
|
20
|
+
exports.rspack = core_1.default;
|
|
17
21
|
function getSwcHtmlMinifier() {
|
|
18
22
|
return html_1.minify;
|
|
19
23
|
}
|
|
@@ -59,6 +63,14 @@ function getSwcJsMinimizerOptions() {
|
|
|
59
63
|
},
|
|
60
64
|
};
|
|
61
65
|
}
|
|
66
|
+
// We need this because of Rspack built-in LightningCSS integration
|
|
67
|
+
// See https://github.com/orgs/browserslist/discussions/846
|
|
68
|
+
function getBrowserslistQueries() {
|
|
69
|
+
const queries = browserslist_1.default.loadConfig({ path: process.cwd() }) ?? [
|
|
70
|
+
...browserslist_1.default.defaults,
|
|
71
|
+
];
|
|
72
|
+
return queries;
|
|
73
|
+
}
|
|
62
74
|
function getLightningCssMinimizerOptions() {
|
|
63
75
|
const queries = (0, browserslist_1.default)();
|
|
64
76
|
return { targets: lightningcss.browserslistToTargets(queries) };
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA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AE,OAAO,CAAC,GAAG,EAAE,EAAC,CAAC,IAAI;QAChE,GAAG,sBAAY,CAAC,QAAQ;KACzB,CAAC;IACF,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": "0.0.0-
|
|
3
|
+
"version": "0.0.0-6101",
|
|
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,6 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
+
"@rspack/core": "^1.0.9",
|
|
21
22
|
"@swc/core": "^1.7.28",
|
|
22
23
|
"@swc/html": "^1.7.28",
|
|
23
24
|
"browserslist": "^4.24.0",
|
|
@@ -31,5 +32,5 @@
|
|
|
31
32
|
"peerDependencies": {
|
|
32
33
|
"@docusaurus/types": "*"
|
|
33
34
|
},
|
|
34
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "16bade8e806ebfd77603c2e52d06a0208843122e"
|
|
35
36
|
}
|
package/src/index.ts
CHANGED
|
@@ -5,12 +5,15 @@
|
|
|
5
5
|
* LICENSE file in the root directory of this source tree.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
import Rspack from '@rspack/core';
|
|
8
9
|
import * as lightningcss from 'lightningcss';
|
|
9
10
|
import browserslist from 'browserslist';
|
|
10
11
|
import {minify as swcHtmlMinifier} from '@swc/html';
|
|
11
12
|
import type {RuleSetRule} from 'webpack';
|
|
12
13
|
import type {JsMinifyOptions} from '@swc/core';
|
|
13
14
|
|
|
15
|
+
export const rspack = Rspack;
|
|
16
|
+
|
|
14
17
|
export function getSwcHtmlMinifier(): typeof swcHtmlMinifier {
|
|
15
18
|
return swcHtmlMinifier;
|
|
16
19
|
}
|
|
@@ -63,6 +66,15 @@ export function getSwcJsMinimizerOptions(): JsMinifyOptions {
|
|
|
63
66
|
};
|
|
64
67
|
}
|
|
65
68
|
|
|
69
|
+
// We need this because of Rspack built-in LightningCSS integration
|
|
70
|
+
// See https://github.com/orgs/browserslist/discussions/846
|
|
71
|
+
export function getBrowserslistQueries(): string[] {
|
|
72
|
+
const queries = browserslist.loadConfig({path: process.cwd()}) ?? [
|
|
73
|
+
...browserslist.defaults,
|
|
74
|
+
];
|
|
75
|
+
return queries;
|
|
76
|
+
}
|
|
77
|
+
|
|
66
78
|
// LightningCSS doesn't expose any type for css-minimizer-webpack-plugin setup
|
|
67
79
|
// So we derive it ourselves
|
|
68
80
|
// see https://lightningcss.dev/docs.html#with-webpack
|