Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(index): export without const in index.mjs #216

Merged
merged 1 commit into from
Jan 28, 2021
Merged

Conversation

remarkablemark
Copy link
Owner

Fixes #214, fixes #213

What is the motivation for this pull request?

fix(index): export without const in index.mjs

What is the current behavior?

Module bundlers (webpack, rollup) that prioritizes the module field in package.json is now getting bundling const (introduced in #210) because of the syntax:

import HTMLReactParser from './index.js';

export default HTMLReactParser;
export const { domToReact, htmlToDOM, attributesToProps } = HTMLReactParser;

This breaks older/legacy browsers like IE11.

What is the new behavior?

Update index.mjs to export without const:

export { default, domToReact, htmlToDOM, attributesToProps } from './index.js';

@remarkablemark remarkablemark added the bug Something isn't working label Jan 28, 2021
@github-actions
Copy link
Contributor

size-limit report 📦

Path Size Loading time (3g) Running time (snapdragon) Total time
dist/html-react-parser.min.js 7.23 KB (0%) 145 ms (0%) 55 ms (-41.16% 🔽) 200 ms

@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 9639afb on fix/es-modules into 6819609 on master.

@remarkablemark remarkablemark merged commit 7beff8d into master Jan 28, 2021
@remarkablemark remarkablemark deleted the fix/es-modules branch January 28, 2021 01:32
@remarkablemark
Copy link
Owner Author

Published v1.2.2:

npm:

npm i html-react-parser@1.2.2

Yarn:

yarn add html-react-parser@1.2.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rollup build breaks in IE11 es6 code sneak in / breaks ie11
2 participants