From 24be0327a8990b1b04d61739ae9099c85f9dda68 Mon Sep 17 00:00:00 2001 From: filzrev <103790468+filzrev@users.noreply.github.com> Date: Tue, 2 Jul 2024 06:11:41 +0900 Subject: [PATCH] feat: add support for search script customization --- templates/build.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/templates/build.js b/templates/build.js index b962b5ab874..f798359ce90 100644 --- a/templates/build.js +++ b/templates/build.js @@ -51,12 +51,24 @@ async function buildModernTemplate() { entryPoints: [ 'modern/src/docfx.ts', 'modern/src/search-worker.ts', + 'modern/src/search.ts', ], external: [ './main.js' ], plugins: [ - sassPlugin() + sassPlugin(), + { + name: 'Exclude `./search` script from bundle', + setup(build) { + build.onResolve({ filter: /^\.\/search$/ }, args => { + return { + path: './search.min.js', + external: true + }; + }); + } + } ], loader, } @@ -113,8 +125,8 @@ function copyToDist() { } function buildContent() { - exec(`dotnet run -f net7.0 --project ../src/docfx/docfx.csproj -- metadata ${project}/docfx.json`) - exec(`dotnet run -f net7.0 --project ../src/docfx/docfx.csproj --no-build -- build ${project}/docfx.json`) + exec(`dotnet run -f net8.0 --project ../src/docfx/docfx.csproj -- metadata ${project}/docfx.json`) + exec(`dotnet run -f net8.0 --project ../src/docfx/docfx.csproj --no-build -- build ${project}/docfx.json`) function exec(cmd) { if (spawnSync(cmd, { stdio: 'inherit', shell: true }).status !== 0) {