File tree 1 file changed +7
-4
lines changed
packages/instantsearch-bundler
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 17
17
18
18
res . writeHead ( 200 , { 'Content-Type' : 'text/javascript' } ) ;
19
19
20
+ // This would be computed based on the configuration
21
+ const mappedWidgets = [ 'searchBox' , 'hits' , 'pagination' ] ;
22
+
20
23
const script = `
21
24
import algoliasearch from 'algoliasearch/lite';
22
25
import instantsearch from 'instantsearch.js';
23
- import { hits } from 'instantsearch.js/es/widgets';
26
+ import { ${ mappedWidgets . join ( ', ' ) } } from 'instantsearch.js/es/widgets';
24
27
25
28
const searchClient = algoliasearch('${ appId } ', '${ apiKey } ');
26
29
const search = instantsearch({
@@ -30,11 +33,11 @@ const search = instantsearch({
30
33
});
31
34
32
35
search.addWidgets([
33
- hits ({ container: '#hits' }),
34
- ])
36
+ block ({ container: '#hits', widgets: [ ${ mappedWidgets . join ( ', ' ) } ] }),
37
+ ]);
35
38
36
39
search.start();
37
- `;
40
+ ` ;
38
41
39
42
const bundle = buildSync ( {
40
43
bundle : true ,
You can’t perform that action at this time.
0 commit comments