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

Add support for ES6/ES2015 module loading #12

Closed
wants to merge 2 commits into from

Conversation

domchristie
Copy link
Contributor

This pull request adds support for ES6/ES2015 module loading by using export default rather than module.exports = in the source, as well as updating the module and jsnext:main fields in package.json.

I am currently using collapse-whitespace and void-elements in Turndown and noticed that the voidElements array was being duplicated in the build version. It seems that Rollup is unable to squash identical imports when using CommonJS modules. Using ES6 module exports seems to fix this issue.

@domchristie
Copy link
Contributor Author

Hmm. The downside is that this does not compile the ES2015 to ES5.

@domchristie
Copy link
Contributor Author

Sorry. Probably a bit premature on this one.

@domchristie domchristie closed this Dec 3, 2017
@domchristie domchristie deleted the es2015 branch December 3, 2017 10:24
@jd-carroll
Copy link

@domchristie Are there any plans to move to a proper semver of collapse-whitespace? The git url supplied in Turndown breaks for users behind a corporate proxy.

@domchristie
Copy link
Contributor Author

Fixed in v4.0.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants