Skip to content

Commit eb69853

Browse files
committed
feat: add support for search script customization
1 parent b089586 commit eb69853

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

templates/build.js

+13-1
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
}

0 commit comments

Comments
 (0)