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

ES6 babel issue #40

Closed
windmaomao opened this issue Feb 16, 2018 · 3 comments
Closed

ES6 babel issue #40

windmaomao opened this issue Feb 16, 2018 · 3 comments

Comments

@windmaomao
Copy link

I followed this, https://babeljs.io/docs/setup/#installation, and then include

md.use(require('markdown-it-anchor/lib'), {})

seems solved const issue when including into project which do not have babel on node_modules folder.

@windmaomao
Copy link
Author

I wish I don't need to do the following,

import Anchor from '../assets/markdown-it-anchor'

Right now, I can't load directly from node_modules, because all ES6 stuff won't get translated inside webpack.

So, either I do babel on your repo, or I do custom import like the above.

@nagaozen
Copy link
Collaborator

This is a known limitation. Nowadays JS grounds are really unstable. In many of my own projects translating node_modules is required anyway because too many packages are using ES6 features. Some developers just stick with ES2015 and never use ES6, others suggests transpiling before publishing. Even in FB it's an open issue. It's probably better to stick with ES2015 because the codebase will be really backwards compatible, but it's a lot of work to convert, test, cover and deploy this project and related ones. Also, it's like going against the flow and losing lots of improments like async module loading, named imports and other stuff built with that system in mind.

@nagaozen
Copy link
Collaborator

Branch 2019-stack should fix this.

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

2 participants