From fc6ca21838e46ccd779f73fb97e88295c0281181 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 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/templates/build.js b/templates/build.js index 20f1cae68d5..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, }