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

ship as ES6 module? #3

Open
valdrinkoshi opened this issue Apr 12, 2018 · 0 comments
Open

ship as ES6 module? #3

valdrinkoshi opened this issue Apr 12, 2018 · 0 comments

Comments

@valdrinkoshi
Copy link

It would be great to have the source shipped as ES6 module, so that it could be imported in browsers without needing a build step.
index.js would just require changing

function matches(elem, selector) {
to this:

export function matches(elem, selector) {

and removing the last line module.exports = matches;

Then, we'd be able to use it in browsers that support script modules, e.g.

<script type=module>
  import {matches} from "./node_modules/dom-matches/index.js"
</script>
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

No branches or pull requests

1 participant