Skip to content

Commit 5d81fce

Browse files
committed
feat: add support for search script customization
1 parent 7b7e3e7 commit 5d81fce

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

templates/build.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,24 @@ async function buildModernTemplate() {
5151
entryPoints: [
5252
'modern/src/docfx.ts',
5353
'modern/src/search-worker.ts',
54+
'modern/src/search.ts',
5455
],
5556
external: [
5657
'./main.js'
5758
],
5859
plugins: [
59-
sassPlugin()
60+
sassPlugin(),
61+
{
62+
name: 'Exclude `./search` script from bundle',
63+
setup(build) {
64+
build.onResolve({ filter: /^\.\/search$/ }, args => {
65+
return {
66+
path: './search.min.js',
67+
external: true
68+
};
69+
});
70+
}
71+
}
6072
],
6173
loader,
6274
}
@@ -113,8 +125,8 @@ function copyToDist() {
113125
}
114126

115127
function buildContent() {
116-
exec(`dotnet run -f net7.0 --project ../src/docfx/docfx.csproj -- metadata ${project}/docfx.json`)
117-
exec(`dotnet run -f net7.0 --project ../src/docfx/docfx.csproj --no-build -- build ${project}/docfx.json`)
128+
exec(`dotnet run -f net8.0 --project ../src/docfx/docfx.csproj -- metadata ${project}/docfx.json`)
129+
exec(`dotnet run -f net8.0 --project ../src/docfx/docfx.csproj --no-build -- build ${project}/docfx.json`)
118130

119131
function exec(cmd) {
120132
if (spawnSync(cmd, { stdio: 'inherit', shell: true }).status !== 0) {

0 commit comments

Comments
 (0)