Skip to content

Commit

Permalink
feat: add support for search script customization
Browse files Browse the repository at this point in the history
  • Loading branch information
filzrev committed Oct 21, 2024
1 parent 7b7e3e7 commit 5d81fce
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions templates/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 5d81fce

Please sign in to comment.