From 424c00f87b5b8b434a4d1c212cda5f2a0fe91571 Mon Sep 17 00:00:00 2001 From: nocontribute <> Date: Fri, 23 Aug 2024 00:55:36 +0900 Subject: [PATCH] perf: use swc-loader around 16% faster (from 45.91s to 38.3s) --- website/docusaurus.config.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/website/docusaurus.config.ts b/website/docusaurus.config.ts index 11952e9afbe..c2cf8d7fda5 100644 --- a/website/docusaurus.config.ts +++ b/website/docusaurus.config.ts @@ -135,5 +135,22 @@ export default { "src": "img/scalameta-logo.png" } } + }, + webpack: { + jsLoader: (isServer) => ({ + loader: "swc-loader", + options: { + jsc: { + parser: { + syntax: "typescript", + tsx: true, + }, + target: "es2020", + }, + module: { + type: isServer ? "commonjs" : "es6", + }, + }, + }), } } satisfies Config