From 9c278a9168566ceb49262beb162f84b27eba9e41 Mon Sep 17 00:00:00 2001 From: Dana Woodman Date: Tue, 18 Jul 2023 14:15:08 -0700 Subject: [PATCH 1/2] Update docs for usage with ESM / ES6 The existing docs show a relative path, not the actual npm module bundle path. I believe this should be correct for ESM/ES6 type environments and will hopefully prevent confusion as found in #341 etc. --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 28b7c37..be0c7b8 100644 --- a/README.md +++ b/README.md @@ -445,12 +445,12 @@ There are 3 types of indexes: The most of you probably need just one of them according to your scenario. -### ES6 Modules (Browser): +### ESM / ES6 Modules (Browser: ```js -import Index from "./index.js"; -import Document from "./document.js"; -import WorkerIndex from "./worker/index.js"; +import Index from "flexsearch/dist/module"; +import Worker from "flexsearch/dist/module/worker"; +import Doc from "flexsearch/dist/module/document"; const index = new Index(options); const document = new Document(options); From 04e533d13c72cc03b8bd7e1d694f41bb5a10933b Mon Sep 17 00:00:00 2001 From: Dana Woodman Date: Tue, 18 Jul 2023 14:15:53 -0700 Subject: [PATCH 2/2] Fix typos --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index be0c7b8..c29f006 100644 --- a/README.md +++ b/README.md @@ -445,12 +445,12 @@ There are 3 types of indexes: The most of you probably need just one of them according to your scenario. -### ESM / ES6 Modules (Browser: +### ESM / ES6 Modules (Browser): ```js import Index from "flexsearch/dist/module"; import Worker from "flexsearch/dist/module/worker"; -import Doc from "flexsearch/dist/module/document"; +import Document from "flexsearch/dist/module/document"; const index = new Index(options); const document = new Document(options);