Skip to content

Commit 75c3f0b

Browse files
committed
feat: set client option to current version set during build
1 parent 0599b36 commit 75c3f0b

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

scripts/build.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@ const options = {
2020
plugins: [inlineCSSPlugin],
2121
logLevel: 'info',
2222
logLimit: 0,
23-
banner: { js: banner }
23+
banner: { js: banner },
24+
define: {
25+
VERSION: `"${version}"`
26+
}
2427
}
2528

2629
// unminified with external dependencies

src/autocomplete/autocomplete.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ export default ({
2929

3030
// Geocode Earth Autocomplete Client
3131
const autocomplete = useMemo(() => {
32-
return createAutocomplete(apiKey, params, options)
32+
return createAutocomplete(apiKey, params, {
33+
...options,
34+
client: `ge-autocomplete${typeof VERSION !== 'undefined' ? `-${VERSION}` : ''}`
35+
})
3336
}, [apiKey, params, options])
3437

3538
// search queries the autocomplete API

0 commit comments

Comments
 (0)