-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #202 from remarkablemark/feat/es-module
feat: add ES Module support
- Loading branch information
Showing
4 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import HTMLDOMParser from './index.js'; | ||
|
||
export default HTMLDOMParser; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,11 @@ | |
"description": "HTML to DOM parser.", | ||
"author": "Mark <[email protected]>", | ||
"main": "index.js", | ||
"module": "index.mjs", | ||
"exports": { | ||
"import": "./index.mjs", | ||
"require": "./index.js" | ||
}, | ||
"scripts": { | ||
"build": "rollup --config", | ||
"clean": "rm -rf dist", | ||
|
@@ -18,6 +23,7 @@ | |
"test:client": "npm run test:client:watch -- --single-run", | ||
"test:client:build": "webpack --config webpack.test.config.js", | ||
"test:client:watch": "npm run test:client:build && karma start", | ||
"test:module": "node --experimental-modules test/module/index.mjs", | ||
"test:server": "nyc mocha test/server" | ||
}, | ||
"repository": { | ||
|
@@ -76,6 +82,8 @@ | |
"files": [ | ||
"/dist", | ||
"/index.d.ts", | ||
"/index.js", | ||
"/index.mjs", | ||
"/lib" | ||
], | ||
"browser": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import assert from 'assert'; | ||
import HTMLDOMParser from '../../index.mjs'; | ||
|
||
assert.strictEqual(typeof HTMLDOMParser, 'function'); |