I’m interested in utilizing InstantSearch in a very locked down environment with strict security requirements that outlaw the use of a CDN, in addition to the majority of the dependencies included in the node package. Has anyone faced this issue before and implemented a lightweight/vanilla JS instantsearch? The only github project I found still made use of a CDN.
We use the CDN in our InstantSearch.js example because it’s an easier way to have a “ready to copy paste” example in a vanilla js environment.
But it’s very easy to convert any of those example to use instantsearch.js and algoliasearch (the search client) as npm packages:
I converted a simple code example here:
- with CDN : https://codesandbox.io/s/github/algolia/doc-code-samples/tree/master/InstantSearch.js/getting-started
- with NPM packages: https://codesandbox.io/s/ais-ecommerce-demo-app-7ub4d
If you use a powerful bundler such as rollup, you can tree shake every part of InstantSearch.js you don’t use.
I hope this helps!