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 Jul 1, 2024
1 parent 21c62b4 commit 24be032
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 24be032

Please sign in to comment.