diff --git a/index.js b/index.js new file mode 100644 index 0000000..a754b9d --- /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 c4ba4a2..a754b9d 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 baea842..144d501 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",