diff --git a/package.json b/package.json index df6cf6f..179feba 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@afosto/instant-search-client", - "version": "1.0.5", + "version": "1.0.6", "private": false, "description": "The Afosto InstantSearch client", "main": "./dist/afosto-instant-search.min.js", @@ -54,7 +54,7 @@ "webpack-dev-server": "^4.6.0" }, "dependencies": { - "uuid": "^8.3.2" + "uuid-random": "^1.3.2" }, "browserslist": [ ">0.2%", diff --git a/rollup.config.js b/rollup.config.js index 0a0d252..658c793 100644 --- a/rollup.config.js +++ b/rollup.config.js @@ -30,6 +30,9 @@ module.exports = [ { input: INPUT, plugins: [nodeResolve()], + external: [ + 'uuid-random', + ], output: [ { dir: 'dist/esm', diff --git a/src/afostoInstantSearch.js b/src/afostoInstantSearch.js index f441067..6facb48 100644 --- a/src/afostoInstantSearch.js +++ b/src/afostoInstantSearch.js @@ -1,7 +1,7 @@ -import { v4 as uuid } from 'uuid'; import { SearchResponseAdapter, SearchRequestAdapter } from './adapters'; import { DEFAULT_OPTIONS } from './constants'; import getSessionID from './utils/getSessionID'; +import uuid from './utils/uuid'; /** * Afosto instant search client diff --git a/src/utils/getSessionID.js b/src/utils/getSessionID.js index 8389c3f..1172503 100644 --- a/src/utils/getSessionID.js +++ b/src/utils/getSessionID.js @@ -1,5 +1,5 @@ -import { v4 as uuid } from 'uuid'; import { SESSION_KEY } from '../constants'; +import uuid from '../utils/uuid'; const getSessionID = () => { const isBrowser = typeof window !== 'undefined'; diff --git a/src/utils/uuid.js b/src/utils/uuid.js new file mode 100644 index 0000000..37e7a58 --- /dev/null +++ b/src/utils/uuid.js @@ -0,0 +1,5 @@ +import uuidv4 from 'uuid-random'; + +const uuid = () => uuidv4(); + +export default uuid; diff --git a/yarn.lock b/yarn.lock index 367430d..e19d92e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3916,6 +3916,11 @@ utils-merge@1.0.1: resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= +uuid-random@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/uuid-random/-/uuid-random-1.3.2.tgz#96715edbaef4e84b1dcf5024b00d16f30220e2d0" + integrity sha512-UOzej0Le/UgkbWEO8flm+0y+G+ljUon1QWTEZOq1rnMAsxo2+SckbiZdKzAHHlVh6gJqI1TjC/xwgR50MuCrBQ== + uuid@^8.3.2: version "8.3.2" resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"