From 5590e26d5b4a6ec5245ac4aa398b8cada5be08db Mon Sep 17 00:00:00 2001 From: Tim Scanlin Date: Thu, 25 Apr 2024 13:08:25 -0700 Subject: [PATCH] switch back to js --- index.js | 6 ++++++ index.mjs | 1 + package.json | 6 +++--- 3 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 index.js diff --git a/index.js b/index.js new file mode 100644 index 00000000..a754b9de --- /dev/null +++ b/index.js @@ -0,0 +1,6 @@ +import { destroy, init, refresh } from './src/js/index-esm.js' +const tocbot = { destroy, init, refresh } + +export { destroy, init, refresh } +export default tocbot + diff --git a/index.mjs b/index.mjs index c4ba4a2b..a754b9de 100644 --- a/index.mjs +++ b/index.mjs @@ -3,3 +3,4 @@ const tocbot = { destroy, init, refresh } export { destroy, init, refresh } export default tocbot + diff --git a/package.json b/package.json index baea8426..144d501a 100644 --- a/package.json +++ b/package.json @@ -3,13 +3,13 @@ "version": "4.27.10", "description": "Generate a table of contents based on the heading structure of a html document.", "main": "./dist/tocbot.js", - "module": "./index.mjs", + "module": "./index.js", "exports": { ".": { "require": "./dist/tocbot.js", - "import": "./index.mjs", + "import": "./index.js", "types": "./index.d.ts", - "default": "./index.mjs" + "default": "./index.js" }, "./styles.css": "./dist/styles.css", "./tocbot.css": "./dist/tocbot.css",