Skip to content

Commit 3e0fd2b

Browse files
fix(esm): make ESM exports explicit in index.mjs and utilities.mjs
Fixes #1228 Vite fails with the error: ``` Uncaught SyntaxError: The requested module '/@fs/Users/.../node_modules/.vite/app/deps/html-react-parser.js?v=719515aa' does not provide an export named 'Element' (at list.tsx:6:31) ```
1 parent 8cc2c36 commit 3e0fd2b

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

esm/index.mjs

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
import HTMLReactParser from '../lib/index.js';
22

3-
export * from '../lib/index.js';
3+
export {
4+
Comment,
5+
Element,
6+
ProcessingInstruction,
7+
Text,
8+
attributesToProps,
9+
domToReact,
10+
htmlToDOM,
11+
} from '../lib/index.js';
412

513
export default HTMLReactParser.default || HTMLReactParser;

esm/utilities.mjs

+8-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,8 @@
1-
export * from '../lib/utilities.js';
1+
export {
2+
isCustomComponent,
3+
setStyleProp,
4+
PRESERVE_CUSTOM_ATTRIBUTES,
5+
ELEMENTS_WITH_NO_TEXT_CHILDREN,
6+
canTextBeChildOfNode,
7+
returnFirstArg,
8+
} from '../lib/utilities.js';

0 commit comments

Comments
 (0)