mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-22 20:47:53 +02:00
feat(core): faster transpiler option - siteConfig.future.experimental_faster.swcJsLoader
(#10435)
This commit is contained in:
parent
349a58453a
commit
418247ec87
30 changed files with 1298 additions and 847 deletions
|
@ -53,7 +53,7 @@ async function createVersionedSidebarFile({
|
|||
}
|
||||
|
||||
// Tests depend on non-default export for mocking.
|
||||
export async function cliDocsVersionCommand(
|
||||
async function cliDocsVersionCommand(
|
||||
version: unknown,
|
||||
{id: pluginId, path: docsPath, sidebarPath}: PluginOptions,
|
||||
{siteDir, i18n}: LoadContext,
|
||||
|
@ -142,3 +142,17 @@ export async function cliDocsVersionCommand(
|
|||
|
||||
logger.success`name=${pluginIdLogPrefix}: version name=${version} created!`;
|
||||
}
|
||||
|
||||
// TODO try to remove this workaround
|
||||
// Why use a default export instead of named exports here?
|
||||
// This is only to make Jest mocking happy
|
||||
// After upgrading Jest/SWC we got this weird mocking error in extendCli tests
|
||||
// "spyOn: Cannot redefine property cliDocsVersionCommand"
|
||||
// I tried various workarounds, and it's the only one that worked :/
|
||||
// See also:
|
||||
// - https://pyk.sh/fixing-typeerror-cannot-redefine-property-x-error-in-jest-tests#heading-solution-2-using-barrel-imports
|
||||
// - https://github.com/aelbore/esbuild-jest/issues/26
|
||||
// - https://stackoverflow.com/questions/67872622/jest-spyon-not-working-on-index-file-cannot-redefine-property/69951703#69951703
|
||||
export default {
|
||||
cliDocsVersionCommand,
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue