From b8436b19147e0146f50982a225e787fd0a53d97d Mon Sep 17 00:00:00 2001 From: Mark Date: Fri, 4 Feb 2022 20:41:49 -0500 Subject: [PATCH] feat: add ES Module support --- index.mjs | 3 +++ package.json | 7 +++++++ 2 files changed, 10 insertions(+) create mode 100644 index.mjs diff --git a/index.mjs b/index.mjs new file mode 100644 index 00000000..fdb5257b --- /dev/null +++ b/index.mjs @@ -0,0 +1,3 @@ +import HTMLDOMParser from './index.js'; + +export default HTMLDOMParser; diff --git a/package.json b/package.json index 3e45c468..d26ae3c7 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,11 @@ "description": "HTML to DOM parser.", "author": "Mark ", "main": "index.js", + "module": "index.mjs", + "exports": { + "import": "./index.mjs", + "require": "./index.js" + }, "scripts": { "build": "rollup --config", "clean": "rm -rf dist", @@ -76,6 +81,8 @@ "files": [ "/dist", "/index.d.ts", + "/index.js", + "/index.mjs", "/lib" ], "browser": {