mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-26 04:57:50 +02:00
feat(core): faster CSS minimizer - siteConfig.future.experimental_faster.lightningCssMinimizer
(#10522)
This commit is contained in:
parent
3b7c8281d5
commit
cba1e02772
12 changed files with 247 additions and 38 deletions
|
@ -6,7 +6,11 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import type {ConfigureWebpackUtils} from '@docusaurus/types';
|
import type {ConfigureWebpackUtils} from '@docusaurus/types';
|
||||||
import type {MinimizerOptions, CustomOptions} from 'terser-webpack-plugin';
|
import type {
|
||||||
|
MinimizerOptions as JsMinimizerOptions,
|
||||||
|
CustomOptions,
|
||||||
|
} from 'terser-webpack-plugin';
|
||||||
|
import type {MinimizerOptions as CssMinimizerOptions} from 'css-minimizer-webpack-plugin';
|
||||||
|
|
||||||
async function importFaster() {
|
async function importFaster() {
|
||||||
return import('@docusaurus/faster');
|
return import('@docusaurus/faster');
|
||||||
|
@ -30,9 +34,16 @@ export async function importSwcJsLoaderFactory(): Promise<
|
||||||
return faster.getSwcJsLoaderFactory;
|
return faster.getSwcJsLoaderFactory;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function importSwcJsMinifierOptions(): Promise<
|
export async function importSwcJsMinimizerOptions(): Promise<
|
||||||
MinimizerOptions<CustomOptions>
|
JsMinimizerOptions<CustomOptions>
|
||||||
> {
|
> {
|
||||||
const faster = await ensureFaster();
|
const faster = await ensureFaster();
|
||||||
return faster.getSwcJsMinifierOptions() as MinimizerOptions<CustomOptions>;
|
return faster.getSwcJsMinimizerOptions() as JsMinimizerOptions<CustomOptions>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function importLightningCssMinimizerOptions(): Promise<
|
||||||
|
CssMinimizerOptions<CustomOptions>
|
||||||
|
> {
|
||||||
|
const faster = await ensureFaster();
|
||||||
|
return faster.getLightningCssMinimizerOptions() as CssMinimizerOptions<CustomOptions>;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,13 +7,16 @@
|
||||||
|
|
||||||
import TerserPlugin from 'terser-webpack-plugin';
|
import TerserPlugin from 'terser-webpack-plugin';
|
||||||
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
|
import CssMinimizerPlugin from 'css-minimizer-webpack-plugin';
|
||||||
import {importSwcJsMinifierOptions} from './importFaster';
|
import {
|
||||||
|
importSwcJsMinimizerOptions,
|
||||||
|
importLightningCssMinimizerOptions,
|
||||||
|
} from './importFaster';
|
||||||
import type {CustomOptions, CssNanoOptions} from 'css-minimizer-webpack-plugin';
|
import type {CustomOptions, CssNanoOptions} from 'css-minimizer-webpack-plugin';
|
||||||
import type {WebpackPluginInstance} from 'webpack';
|
import type {WebpackPluginInstance} from 'webpack';
|
||||||
import type {CurrentBundler, FasterConfig} from '@docusaurus/types';
|
import type {CurrentBundler, FasterConfig} from '@docusaurus/types';
|
||||||
|
|
||||||
export type MinimizersConfig = {
|
export type MinimizersConfig = {
|
||||||
faster: Pick<FasterConfig, 'swcJsMinimizer'>;
|
faster: Pick<FasterConfig, 'swcJsMinimizer' | 'lightningCssMinimizer'>;
|
||||||
currentBundler: CurrentBundler;
|
currentBundler: CurrentBundler;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -31,9 +34,11 @@ function getTerserParallel() {
|
||||||
return terserParallel;
|
return terserParallel;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getJsMinimizer({faster}: MinimizersConfig) {
|
async function getJsMinimizer({
|
||||||
|
faster,
|
||||||
|
}: MinimizersConfig): Promise<WebpackPluginInstance> {
|
||||||
if (faster.swcJsMinimizer) {
|
if (faster.swcJsMinimizer) {
|
||||||
const terserOptions = await importSwcJsMinifierOptions();
|
const terserOptions = await importSwcJsMinimizerOptions();
|
||||||
return new TerserPlugin({
|
return new TerserPlugin({
|
||||||
parallel: getTerserParallel(),
|
parallel: getTerserParallel(),
|
||||||
minify: TerserPlugin.swcMinify,
|
minify: TerserPlugin.swcMinify,
|
||||||
|
@ -69,7 +74,21 @@ async function getJsMinimizer({faster}: MinimizersConfig) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getAdvancedCssMinifier() {
|
async function getLightningCssMinimizer(): Promise<WebpackPluginInstance> {
|
||||||
|
return new CssMinimizerPlugin({
|
||||||
|
minify: CssMinimizerPlugin.lightningCssMinify,
|
||||||
|
minimizerOptions: await importLightningCssMinimizerOptions(),
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getCssNanoMinimizer(): Promise<WebpackPluginInstance> {
|
||||||
|
// This is an historical env variable to opt-out of the advanced minimizer
|
||||||
|
// Sometimes there's a bug in it and people are happy to disable it
|
||||||
|
const useSimpleCssMinifier = process.env.USE_SIMPLE_CSS_MINIFIER === 'true';
|
||||||
|
if (useSimpleCssMinifier) {
|
||||||
|
return new CssMinimizerPlugin();
|
||||||
|
}
|
||||||
|
|
||||||
// Using the array syntax to add 2 minimizers
|
// Using the array syntax to add 2 minimizers
|
||||||
// see https://github.com/webpack-contrib/css-minimizer-webpack-plugin#array
|
// see https://github.com/webpack-contrib/css-minimizer-webpack-plugin#array
|
||||||
return new CssMinimizerPlugin<[CssNanoOptions, CustomOptions]>({
|
return new CssMinimizerPlugin<[CssNanoOptions, CustomOptions]>({
|
||||||
|
@ -101,21 +120,18 @@ function getAdvancedCssMinifier() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function getCssMinimizer(): WebpackPluginInstance {
|
async function getCssMinimizer(
|
||||||
// This is an historical env variable to opt-out of the advanced minifier
|
params: MinimizersConfig,
|
||||||
// Sometimes there's a bug in it and people are happy to disable it
|
): Promise<WebpackPluginInstance> {
|
||||||
const useSimpleCssMinifier = process.env.USE_SIMPLE_CSS_MINIFIER === 'true';
|
return params.faster.lightningCssMinimizer
|
||||||
if (useSimpleCssMinifier) {
|
? getLightningCssMinimizer()
|
||||||
return new CssMinimizerPlugin();
|
: getCssNanoMinimizer();
|
||||||
} else {
|
|
||||||
return getAdvancedCssMinifier();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getWebpackMinimizers(
|
async function getWebpackMinimizers(
|
||||||
params: MinimizersConfig,
|
params: MinimizersConfig,
|
||||||
): Promise<WebpackPluginInstance[]> {
|
): Promise<WebpackPluginInstance[]> {
|
||||||
return Promise.all([getJsMinimizer(params), getCssMinimizer()]);
|
return Promise.all([getJsMinimizer(params), getCssMinimizer(params)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
async function getRspackMinimizers({
|
async function getRspackMinimizers({
|
||||||
|
|
|
@ -18,9 +18,11 @@
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"webpack": "^5.88.1",
|
|
||||||
"@swc/core": "^1.7.14",
|
"@swc/core": "^1.7.14",
|
||||||
"swc-loader": "^0.2.6"
|
"browserslist": "^4.24.0",
|
||||||
|
"lightningcss": "^1.27.0",
|
||||||
|
"swc-loader": "^0.2.6",
|
||||||
|
"webpack": "^5.88.1"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.0"
|
"node": ">=18.0"
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import * as lightningcss from 'lightningcss';
|
||||||
|
import browserslist from 'browserslist';
|
||||||
import type {RuleSetRule} from 'webpack';
|
import type {RuleSetRule} from 'webpack';
|
||||||
import type {JsMinifyOptions} from '@swc/core';
|
import type {JsMinifyOptions} from '@swc/core';
|
||||||
|
|
||||||
|
@ -39,7 +41,7 @@ export function getSwcJsLoaderFactory({
|
||||||
// They should rather be kept in sync for now to avoid any unexpected behavior
|
// They should rather be kept in sync for now to avoid any unexpected behavior
|
||||||
// The goal of faster minifier is not to fine-tune options but only to be faster
|
// The goal of faster minifier is not to fine-tune options but only to be faster
|
||||||
// See core minification.ts
|
// See core minification.ts
|
||||||
export function getSwcJsMinifierOptions(): JsMinifyOptions {
|
export function getSwcJsMinimizerOptions(): JsMinifyOptions {
|
||||||
return {
|
return {
|
||||||
ecma: 2020,
|
ecma: 2020,
|
||||||
compress: {
|
compress: {
|
||||||
|
@ -55,3 +57,16 @@ export function getSwcJsMinifierOptions(): JsMinifyOptions {
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// LightningCSS doesn't expose any type for css-minimizer-webpack-plugin setup
|
||||||
|
// So we derive it ourselves
|
||||||
|
// see https://lightningcss.dev/docs.html#with-webpack
|
||||||
|
type LightningCssMinimizerOptions = Omit<
|
||||||
|
lightningcss.TransformOptions<never>,
|
||||||
|
'filename' | 'code'
|
||||||
|
>;
|
||||||
|
|
||||||
|
export function getLightningCssMinimizerOptions(): LightningCssMinimizerOptions {
|
||||||
|
const queries = browserslist();
|
||||||
|
return {targets: lightningcss.browserslistToTargets(queries)};
|
||||||
|
}
|
||||||
|
|
1
packages/docusaurus-types/src/config.d.ts
vendored
1
packages/docusaurus-types/src/config.d.ts
vendored
|
@ -126,6 +126,7 @@ export type StorageConfig = {
|
||||||
export type FasterConfig = {
|
export type FasterConfig = {
|
||||||
swcJsLoader: boolean;
|
swcJsLoader: boolean;
|
||||||
swcJsMinimizer: boolean;
|
swcJsMinimizer: boolean;
|
||||||
|
lightningCssMinimizer: boolean;
|
||||||
mdxCrossCompilerCache: boolean;
|
mdxCrossCompilerCache: boolean;
|
||||||
rspackBundler: boolean;
|
rspackBundler: boolean;
|
||||||
};
|
};
|
||||||
|
|
|
@ -9,6 +9,7 @@ exports[`loadSiteConfig website with .cjs siteConfig 1`] = `
|
||||||
"customFields": {},
|
"customFields": {},
|
||||||
"future": {
|
"future": {
|
||||||
"experimental_faster": {
|
"experimental_faster": {
|
||||||
|
"lightningCssMinimizer": false,
|
||||||
"mdxCrossCompilerCache": false,
|
"mdxCrossCompilerCache": false,
|
||||||
"rspackBundler": false,
|
"rspackBundler": false,
|
||||||
"swcJsLoader": false,
|
"swcJsLoader": false,
|
||||||
|
@ -76,6 +77,7 @@ exports[`loadSiteConfig website with ts + js config 1`] = `
|
||||||
"customFields": {},
|
"customFields": {},
|
||||||
"future": {
|
"future": {
|
||||||
"experimental_faster": {
|
"experimental_faster": {
|
||||||
|
"lightningCssMinimizer": false,
|
||||||
"mdxCrossCompilerCache": false,
|
"mdxCrossCompilerCache": false,
|
||||||
"rspackBundler": false,
|
"rspackBundler": false,
|
||||||
"swcJsLoader": false,
|
"swcJsLoader": false,
|
||||||
|
@ -143,6 +145,7 @@ exports[`loadSiteConfig website with valid JS CJS config 1`] = `
|
||||||
"customFields": {},
|
"customFields": {},
|
||||||
"future": {
|
"future": {
|
||||||
"experimental_faster": {
|
"experimental_faster": {
|
||||||
|
"lightningCssMinimizer": false,
|
||||||
"mdxCrossCompilerCache": false,
|
"mdxCrossCompilerCache": false,
|
||||||
"rspackBundler": false,
|
"rspackBundler": false,
|
||||||
"swcJsLoader": false,
|
"swcJsLoader": false,
|
||||||
|
@ -210,6 +213,7 @@ exports[`loadSiteConfig website with valid JS ESM config 1`] = `
|
||||||
"customFields": {},
|
"customFields": {},
|
||||||
"future": {
|
"future": {
|
||||||
"experimental_faster": {
|
"experimental_faster": {
|
||||||
|
"lightningCssMinimizer": false,
|
||||||
"mdxCrossCompilerCache": false,
|
"mdxCrossCompilerCache": false,
|
||||||
"rspackBundler": false,
|
"rspackBundler": false,
|
||||||
"swcJsLoader": false,
|
"swcJsLoader": false,
|
||||||
|
@ -277,6 +281,7 @@ exports[`loadSiteConfig website with valid TypeScript CJS config 1`] = `
|
||||||
"customFields": {},
|
"customFields": {},
|
||||||
"future": {
|
"future": {
|
||||||
"experimental_faster": {
|
"experimental_faster": {
|
||||||
|
"lightningCssMinimizer": false,
|
||||||
"mdxCrossCompilerCache": false,
|
"mdxCrossCompilerCache": false,
|
||||||
"rspackBundler": false,
|
"rspackBundler": false,
|
||||||
"swcJsLoader": false,
|
"swcJsLoader": false,
|
||||||
|
@ -344,6 +349,7 @@ exports[`loadSiteConfig website with valid TypeScript ESM config 1`] = `
|
||||||
"customFields": {},
|
"customFields": {},
|
||||||
"future": {
|
"future": {
|
||||||
"experimental_faster": {
|
"experimental_faster": {
|
||||||
|
"lightningCssMinimizer": false,
|
||||||
"mdxCrossCompilerCache": false,
|
"mdxCrossCompilerCache": false,
|
||||||
"rspackBundler": false,
|
"rspackBundler": false,
|
||||||
"swcJsLoader": false,
|
"swcJsLoader": false,
|
||||||
|
@ -411,6 +417,7 @@ exports[`loadSiteConfig website with valid async config 1`] = `
|
||||||
"customFields": {},
|
"customFields": {},
|
||||||
"future": {
|
"future": {
|
||||||
"experimental_faster": {
|
"experimental_faster": {
|
||||||
|
"lightningCssMinimizer": false,
|
||||||
"mdxCrossCompilerCache": false,
|
"mdxCrossCompilerCache": false,
|
||||||
"rspackBundler": false,
|
"rspackBundler": false,
|
||||||
"swcJsLoader": false,
|
"swcJsLoader": false,
|
||||||
|
@ -480,6 +487,7 @@ exports[`loadSiteConfig website with valid async config creator function 1`] = `
|
||||||
"customFields": {},
|
"customFields": {},
|
||||||
"future": {
|
"future": {
|
||||||
"experimental_faster": {
|
"experimental_faster": {
|
||||||
|
"lightningCssMinimizer": false,
|
||||||
"mdxCrossCompilerCache": false,
|
"mdxCrossCompilerCache": false,
|
||||||
"rspackBundler": false,
|
"rspackBundler": false,
|
||||||
"swcJsLoader": false,
|
"swcJsLoader": false,
|
||||||
|
@ -549,6 +557,7 @@ exports[`loadSiteConfig website with valid config creator function 1`] = `
|
||||||
"customFields": {},
|
"customFields": {},
|
||||||
"future": {
|
"future": {
|
||||||
"experimental_faster": {
|
"experimental_faster": {
|
||||||
|
"lightningCssMinimizer": false,
|
||||||
"mdxCrossCompilerCache": false,
|
"mdxCrossCompilerCache": false,
|
||||||
"rspackBundler": false,
|
"rspackBundler": false,
|
||||||
"swcJsLoader": false,
|
"swcJsLoader": false,
|
||||||
|
@ -621,6 +630,7 @@ exports[`loadSiteConfig website with valid siteConfig 1`] = `
|
||||||
"favicon": "img/docusaurus.ico",
|
"favicon": "img/docusaurus.ico",
|
||||||
"future": {
|
"future": {
|
||||||
"experimental_faster": {
|
"experimental_faster": {
|
||||||
|
"lightningCssMinimizer": false,
|
||||||
"mdxCrossCompilerCache": false,
|
"mdxCrossCompilerCache": false,
|
||||||
"rspackBundler": false,
|
"rspackBundler": false,
|
||||||
"swcJsLoader": false,
|
"swcJsLoader": false,
|
||||||
|
|
|
@ -83,6 +83,7 @@ exports[`load loads props for site with custom i18n path 1`] = `
|
||||||
"customFields": {},
|
"customFields": {},
|
||||||
"future": {
|
"future": {
|
||||||
"experimental_faster": {
|
"experimental_faster": {
|
||||||
|
"lightningCssMinimizer": false,
|
||||||
"mdxCrossCompilerCache": false,
|
"mdxCrossCompilerCache": false,
|
||||||
"rspackBundler": false,
|
"rspackBundler": false,
|
||||||
"swcJsLoader": false,
|
"swcJsLoader": false,
|
||||||
|
|
|
@ -48,6 +48,7 @@ describe('normalizeConfig', () => {
|
||||||
experimental_faster: {
|
experimental_faster: {
|
||||||
swcJsLoader: true,
|
swcJsLoader: true,
|
||||||
swcJsMinimizer: true,
|
swcJsMinimizer: true,
|
||||||
|
lightningCssMinimizer: true,
|
||||||
mdxCrossCompilerCache: true,
|
mdxCrossCompilerCache: true,
|
||||||
rspackBundler: true,
|
rspackBundler: true,
|
||||||
},
|
},
|
||||||
|
@ -745,6 +746,7 @@ describe('future', () => {
|
||||||
experimental_faster: {
|
experimental_faster: {
|
||||||
swcJsLoader: true,
|
swcJsLoader: true,
|
||||||
swcJsMinimizer: true,
|
swcJsMinimizer: true,
|
||||||
|
lightningCssMinimizer: true,
|
||||||
mdxCrossCompilerCache: true,
|
mdxCrossCompilerCache: true,
|
||||||
rspackBundler: true,
|
rspackBundler: true,
|
||||||
},
|
},
|
||||||
|
@ -1096,6 +1098,7 @@ describe('future', () => {
|
||||||
const faster: FasterConfig = {
|
const faster: FasterConfig = {
|
||||||
swcJsLoader: true,
|
swcJsLoader: true,
|
||||||
swcJsMinimizer: true,
|
swcJsMinimizer: true,
|
||||||
|
lightningCssMinimizer: true,
|
||||||
mdxCrossCompilerCache: true,
|
mdxCrossCompilerCache: true,
|
||||||
rspackBundler: true,
|
rspackBundler: true,
|
||||||
};
|
};
|
||||||
|
@ -1281,6 +1284,77 @@ describe('future', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('lightningCssMinimizer', () => {
|
||||||
|
it('accepts - undefined', () => {
|
||||||
|
const faster: Partial<FasterConfig> = {
|
||||||
|
lightningCssMinimizer: undefined,
|
||||||
|
};
|
||||||
|
expect(
|
||||||
|
normalizeConfig({
|
||||||
|
future: {
|
||||||
|
experimental_faster: faster,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
).toEqual(fasterContaining({lightningCssMinimizer: false}));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('accepts - true', () => {
|
||||||
|
const faster: Partial<FasterConfig> = {
|
||||||
|
lightningCssMinimizer: true,
|
||||||
|
};
|
||||||
|
expect(
|
||||||
|
normalizeConfig({
|
||||||
|
future: {
|
||||||
|
experimental_faster: faster,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
).toEqual(fasterContaining({lightningCssMinimizer: true}));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('accepts - false', () => {
|
||||||
|
const faster: Partial<FasterConfig> = {
|
||||||
|
lightningCssMinimizer: false,
|
||||||
|
};
|
||||||
|
expect(
|
||||||
|
normalizeConfig({
|
||||||
|
future: {
|
||||||
|
experimental_faster: faster,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
).toEqual(fasterContaining({lightningCssMinimizer: false}));
|
||||||
|
});
|
||||||
|
|
||||||
|
it('rejects - null', () => {
|
||||||
|
// @ts-expect-error: invalid
|
||||||
|
const faster: Partial<FasterConfig> = {lightningCssMinimizer: 42};
|
||||||
|
expect(() =>
|
||||||
|
normalizeConfig({
|
||||||
|
future: {
|
||||||
|
experimental_faster: faster,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
).toThrowErrorMatchingInlineSnapshot(`
|
||||||
|
""future.experimental_faster.lightningCssMinimizer" must be a boolean
|
||||||
|
"
|
||||||
|
`);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('rejects - number', () => {
|
||||||
|
// @ts-expect-error: invalid
|
||||||
|
const faster: Partial<FasterConfig> = {lightningCssMinimizer: 42};
|
||||||
|
expect(() =>
|
||||||
|
normalizeConfig({
|
||||||
|
future: {
|
||||||
|
experimental_faster: faster,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
).toThrowErrorMatchingInlineSnapshot(`
|
||||||
|
""future.experimental_faster.lightningCssMinimizer" must be a boolean
|
||||||
|
"
|
||||||
|
`);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('mdxCrossCompilerCache', () => {
|
describe('mdxCrossCompilerCache', () => {
|
||||||
it('accepts - undefined', () => {
|
it('accepts - undefined', () => {
|
||||||
const faster: Partial<FasterConfig> = {
|
const faster: Partial<FasterConfig> = {
|
||||||
|
|
|
@ -44,6 +44,7 @@ export const DEFAULT_STORAGE_CONFIG: StorageConfig = {
|
||||||
export const DEFAULT_FASTER_CONFIG: FasterConfig = {
|
export const DEFAULT_FASTER_CONFIG: FasterConfig = {
|
||||||
swcJsLoader: false,
|
swcJsLoader: false,
|
||||||
swcJsMinimizer: false,
|
swcJsMinimizer: false,
|
||||||
|
lightningCssMinimizer: false,
|
||||||
mdxCrossCompilerCache: false,
|
mdxCrossCompilerCache: false,
|
||||||
rspackBundler: false,
|
rspackBundler: false,
|
||||||
};
|
};
|
||||||
|
@ -52,6 +53,7 @@ export const DEFAULT_FASTER_CONFIG: FasterConfig = {
|
||||||
export const DEFAULT_FASTER_CONFIG_TRUE: FasterConfig = {
|
export const DEFAULT_FASTER_CONFIG_TRUE: FasterConfig = {
|
||||||
swcJsLoader: true,
|
swcJsLoader: true,
|
||||||
swcJsMinimizer: true,
|
swcJsMinimizer: true,
|
||||||
|
lightningCssMinimizer: true,
|
||||||
mdxCrossCompilerCache: true,
|
mdxCrossCompilerCache: true,
|
||||||
rspackBundler: true,
|
rspackBundler: true,
|
||||||
};
|
};
|
||||||
|
@ -221,6 +223,9 @@ const FASTER_CONFIG_SCHEMA = Joi.alternatives()
|
||||||
swcJsMinimizer: Joi.boolean().default(
|
swcJsMinimizer: Joi.boolean().default(
|
||||||
DEFAULT_FASTER_CONFIG.swcJsMinimizer,
|
DEFAULT_FASTER_CONFIG.swcJsMinimizer,
|
||||||
),
|
),
|
||||||
|
lightningCssMinimizer: Joi.boolean().default(
|
||||||
|
DEFAULT_FASTER_CONFIG.lightningCssMinimizer,
|
||||||
|
),
|
||||||
mdxCrossCompilerCache: Joi.boolean().default(
|
mdxCrossCompilerCache: Joi.boolean().default(
|
||||||
DEFAULT_FASTER_CONFIG.mdxCrossCompilerCache,
|
DEFAULT_FASTER_CONFIG.mdxCrossCompilerCache,
|
||||||
),
|
),
|
||||||
|
|
|
@ -164,6 +164,7 @@ lastmod
|
||||||
Lastmod
|
Lastmod
|
||||||
lifecycles
|
lifecycles
|
||||||
Lifecycles
|
Lifecycles
|
||||||
|
lightningcss
|
||||||
linkify
|
linkify
|
||||||
Linkify
|
Linkify
|
||||||
Localizable
|
Localizable
|
||||||
|
|
|
@ -29,11 +29,11 @@ const EXPECTED_CSS_MARKERS = [
|
||||||
// Note, Infima and site classes are optimized/deduplicated and put at the top
|
// Note, Infima and site classes are optimized/deduplicated and put at the top
|
||||||
// We don't agree yet on what should be the order for those classes
|
// We don't agree yet on what should be the order for those classes
|
||||||
// See https://github.com/facebook/docusaurus/pull/6222
|
// See https://github.com/facebook/docusaurus/pull/6222
|
||||||
'.markdown>h2',
|
|
||||||
'.button--outline.button--active',
|
|
||||||
'--ifm-color-scheme:light',
|
'--ifm-color-scheme:light',
|
||||||
'.col[class*=col--]',
|
'.col[class*=col--]',
|
||||||
'.padding-vert--xl',
|
'.padding-vert--xl',
|
||||||
|
'.markdown>h2',
|
||||||
|
'.button--outline.button--active',
|
||||||
'.footer__link-item',
|
'.footer__link-item',
|
||||||
'.navbar__title',
|
'.navbar__title',
|
||||||
'.pagination__item',
|
'.pagination__item',
|
||||||
|
|
101
yarn.lock
101
yarn.lock
|
@ -4959,13 +4959,13 @@ braces@^3.0.3, braces@~3.0.2:
|
||||||
dependencies:
|
dependencies:
|
||||||
fill-range "^7.1.1"
|
fill-range "^7.1.1"
|
||||||
|
|
||||||
browserslist@^4.0.0, browserslist@^4.18.1, browserslist@^4.21.10, browserslist@^4.23.0, browserslist@^4.23.1, browserslist@^4.23.3:
|
browserslist@^4.0.0, browserslist@^4.18.1, browserslist@^4.21.10, browserslist@^4.23.0, browserslist@^4.23.1, browserslist@^4.23.3, browserslist@^4.24.0:
|
||||||
version "4.23.3"
|
version "4.24.0"
|
||||||
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.23.3.tgz#debb029d3c93ebc97ffbc8d9cbb03403e227c800"
|
resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.0.tgz#a1325fe4bc80b64fda169629fc01b3d6cecd38d4"
|
||||||
integrity sha512-btwCFJVjI4YWDNfau8RhZ+B1Q/VLoUITrm3RlP6y1tYGWIOa+InuYiRGXUBXo8nA1qKmHMyLB/iVQg5TT4eFoA==
|
integrity sha512-Rmb62sR1Zpjql25eSanFGEhAxcFwfA1K0GuQcLoaJBAcENegrQut3hYdhXFF1obQfiDyqIW/cLM5HSJ/9k884A==
|
||||||
dependencies:
|
dependencies:
|
||||||
caniuse-lite "^1.0.30001646"
|
caniuse-lite "^1.0.30001663"
|
||||||
electron-to-chromium "^1.5.4"
|
electron-to-chromium "^1.5.28"
|
||||||
node-releases "^2.0.18"
|
node-releases "^2.0.18"
|
||||||
update-browserslist-db "^1.1.0"
|
update-browserslist-db "^1.1.0"
|
||||||
|
|
||||||
|
@ -5186,10 +5186,10 @@ caniuse-api@^3.0.0:
|
||||||
lodash.memoize "^4.1.2"
|
lodash.memoize "^4.1.2"
|
||||||
lodash.uniq "^4.5.0"
|
lodash.uniq "^4.5.0"
|
||||||
|
|
||||||
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001646:
|
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001646, caniuse-lite@^1.0.30001663:
|
||||||
version "1.0.30001651"
|
version "1.0.30001664"
|
||||||
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001651.tgz#52de59529e8b02b1aedcaaf5c05d9e23c0c28138"
|
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001664.tgz#d588d75c9682d3301956b05a3749652a80677df4"
|
||||||
integrity sha512-9Cf+Xv1jJNe1xPZLGuUXLNkE1BoDkqRqYyFJ9TDYSqhduqA4hu4oR9HluGoWYQC/aj8WHjsGVV+bwkh0+tegRg==
|
integrity sha512-AmE7k4dXiNKQipgn7a2xg558IRqPN3jMQY/rOsbxDhrd0tyChwbITBfiwtnqz8bi2M5mIWbxAYBvk7W7QBUS2g==
|
||||||
|
|
||||||
ccount@^2.0.0:
|
ccount@^2.0.0:
|
||||||
version "2.0.1"
|
version "2.0.1"
|
||||||
|
@ -6897,6 +6897,11 @@ detect-indent@^5.0.0:
|
||||||
resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d"
|
resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d"
|
||||||
integrity sha512-rlpvsxUtM0PQvy9iZe640/IWwWYyBsTApREbA1pHOpmOUIl9MkP/U4z7vTtg4Oaojvqhxt7sdufnT0EzGaR31g==
|
integrity sha512-rlpvsxUtM0PQvy9iZe640/IWwWYyBsTApREbA1pHOpmOUIl9MkP/U4z7vTtg4Oaojvqhxt7sdufnT0EzGaR31g==
|
||||||
|
|
||||||
|
detect-libc@^1.0.3:
|
||||||
|
version "1.0.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
|
||||||
|
integrity sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==
|
||||||
|
|
||||||
detect-libc@^2.0.0, detect-libc@^2.0.2:
|
detect-libc@^2.0.0, detect-libc@^2.0.2:
|
||||||
version "2.0.2"
|
version "2.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.2.tgz#8ccf2ba9315350e1241b88d0ac3b0e1fbd99605d"
|
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.2.tgz#8ccf2ba9315350e1241b88d0ac3b0e1fbd99605d"
|
||||||
|
@ -7103,10 +7108,10 @@ ejs@^3.1.6, ejs@^3.1.7:
|
||||||
dependencies:
|
dependencies:
|
||||||
jake "^10.8.5"
|
jake "^10.8.5"
|
||||||
|
|
||||||
electron-to-chromium@^1.5.4:
|
electron-to-chromium@^1.5.28:
|
||||||
version "1.5.13"
|
version "1.5.29"
|
||||||
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.13.tgz#1abf0410c5344b2b829b7247e031f02810d442e6"
|
resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.29.tgz#aa592a3caa95d07cc26a66563accf99fa573a1ee"
|
||||||
integrity sha512-lbBcvtIJ4J6sS4tb5TLp1b4LyfCdMkwStzXPyAgVgTRAsep4bvrAGaBOP7ZJtQMNJpSQ9SqG4brWOroNaQtm7Q==
|
integrity sha512-PF8n2AlIhCKXQ+gTpiJi0VhcHDb69kYX4MtCiivctc2QD3XuNZ/XIOlbGzt7WAjjEev0TtaH6Cu3arZExm5DOw==
|
||||||
|
|
||||||
emittery@^0.13.1:
|
emittery@^0.13.1:
|
||||||
version "0.13.1"
|
version "0.13.1"
|
||||||
|
@ -10737,6 +10742,74 @@ libnpmpublish@7.1.4:
|
||||||
sigstore "^1.4.0"
|
sigstore "^1.4.0"
|
||||||
ssri "^10.0.1"
|
ssri "^10.0.1"
|
||||||
|
|
||||||
|
lightningcss-darwin-arm64@1.27.0:
|
||||||
|
version "1.27.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.27.0.tgz#565bd610533941cba648a70e105987578d82f996"
|
||||||
|
integrity sha512-Gl/lqIXY+d+ySmMbgDf0pgaWSqrWYxVHoc88q+Vhf2YNzZ8DwoRzGt5NZDVqqIW5ScpSnmmjcgXP87Dn2ylSSQ==
|
||||||
|
|
||||||
|
lightningcss-darwin-x64@1.27.0:
|
||||||
|
version "1.27.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.27.0.tgz#c906a267237b1c7fe08bff6c5ac032c099bc9482"
|
||||||
|
integrity sha512-0+mZa54IlcNAoQS9E0+niovhyjjQWEMrwW0p2sSdLRhLDc8LMQ/b67z7+B5q4VmjYCMSfnFi3djAAQFIDuj/Tg==
|
||||||
|
|
||||||
|
lightningcss-freebsd-x64@1.27.0:
|
||||||
|
version "1.27.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.27.0.tgz#a7c3c4d6ee18dffeb8fa69f14f8f9267f7dc0c34"
|
||||||
|
integrity sha512-n1sEf85fePoU2aDN2PzYjoI8gbBqnmLGEhKq7q0DKLj0UTVmOTwDC7PtLcy/zFxzASTSBlVQYJUhwIStQMIpRA==
|
||||||
|
|
||||||
|
lightningcss-linux-arm-gnueabihf@1.27.0:
|
||||||
|
version "1.27.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.27.0.tgz#c7c16432a571ec877bf734fe500e4a43d48c2814"
|
||||||
|
integrity sha512-MUMRmtdRkOkd5z3h986HOuNBD1c2lq2BSQA1Jg88d9I7bmPGx08bwGcnB75dvr17CwxjxD6XPi3Qh8ArmKFqCA==
|
||||||
|
|
||||||
|
lightningcss-linux-arm64-gnu@1.27.0:
|
||||||
|
version "1.27.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.27.0.tgz#cfd9e18df1cd65131da286ddacfa3aee6862a752"
|
||||||
|
integrity sha512-cPsxo1QEWq2sfKkSq2Bq5feQDHdUEwgtA9KaB27J5AX22+l4l0ptgjMZZtYtUnteBofjee+0oW1wQ1guv04a7A==
|
||||||
|
|
||||||
|
lightningcss-linux-arm64-musl@1.27.0:
|
||||||
|
version "1.27.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.27.0.tgz#6682ff6b9165acef9a6796bd9127a8e1247bb0ed"
|
||||||
|
integrity sha512-rCGBm2ax7kQ9pBSeITfCW9XSVF69VX+fm5DIpvDZQl4NnQoMQyRwhZQm9pd59m8leZ1IesRqWk2v/DntMo26lg==
|
||||||
|
|
||||||
|
lightningcss-linux-x64-gnu@1.27.0:
|
||||||
|
version "1.27.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.27.0.tgz#714221212ad184ddfe974bbb7dbe9300dfde4bc0"
|
||||||
|
integrity sha512-Dk/jovSI7qqhJDiUibvaikNKI2x6kWPN79AQiD/E/KeQWMjdGe9kw51RAgoWFDi0coP4jinaH14Nrt/J8z3U4A==
|
||||||
|
|
||||||
|
lightningcss-linux-x64-musl@1.27.0:
|
||||||
|
version "1.27.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.27.0.tgz#247958daf622a030a6dc2285afa16b7184bdf21e"
|
||||||
|
integrity sha512-QKjTxXm8A9s6v9Tg3Fk0gscCQA1t/HMoF7Woy1u68wCk5kS4fR+q3vXa1p3++REW784cRAtkYKrPy6JKibrEZA==
|
||||||
|
|
||||||
|
lightningcss-win32-arm64-msvc@1.27.0:
|
||||||
|
version "1.27.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.27.0.tgz#64cfe473c264ef5dc275a4d57a516d77fcac6bc9"
|
||||||
|
integrity sha512-/wXegPS1hnhkeG4OXQKEMQeJd48RDC3qdh+OA8pCuOPCyvnm/yEayrJdJVqzBsqpy1aJklRCVxscpFur80o6iQ==
|
||||||
|
|
||||||
|
lightningcss-win32-x64-msvc@1.27.0:
|
||||||
|
version "1.27.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.27.0.tgz#237d0dc87d9cdc9cf82536bcbc07426fa9f3f422"
|
||||||
|
integrity sha512-/OJLj94Zm/waZShL8nB5jsNj3CfNATLCTyFxZyouilfTmSoLDX7VlVAmhPHoZWVFp4vdmoiEbPEYC8HID3m6yw==
|
||||||
|
|
||||||
|
lightningcss@^1.27.0:
|
||||||
|
version "1.27.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/lightningcss/-/lightningcss-1.27.0.tgz#d4608e63044343836dd9769f6c8b5d607867649a"
|
||||||
|
integrity sha512-8f7aNmS1+etYSLHht0fQApPc2kNO8qGRutifN5rVIc6Xo6ABsEbqOr758UwI7ALVbTt4x1fllKt0PYgzD9S3yQ==
|
||||||
|
dependencies:
|
||||||
|
detect-libc "^1.0.3"
|
||||||
|
optionalDependencies:
|
||||||
|
lightningcss-darwin-arm64 "1.27.0"
|
||||||
|
lightningcss-darwin-x64 "1.27.0"
|
||||||
|
lightningcss-freebsd-x64 "1.27.0"
|
||||||
|
lightningcss-linux-arm-gnueabihf "1.27.0"
|
||||||
|
lightningcss-linux-arm64-gnu "1.27.0"
|
||||||
|
lightningcss-linux-arm64-musl "1.27.0"
|
||||||
|
lightningcss-linux-x64-gnu "1.27.0"
|
||||||
|
lightningcss-linux-x64-musl "1.27.0"
|
||||||
|
lightningcss-win32-arm64-msvc "1.27.0"
|
||||||
|
lightningcss-win32-x64-msvc "1.27.0"
|
||||||
|
|
||||||
lilconfig@2.1.0:
|
lilconfig@2.1.0:
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52"
|
resolved "https://registry.yarnpkg.com/lilconfig/-/lilconfig-2.1.0.tgz#78e23ac89ebb7e1bfbf25b18043de756548e7f52"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue