markdown-component-loader icon indicating copy to clipboard operation
markdown-component-loader copied to clipboard

Node.js module output format

Open davidtheclark opened this issue 8 years ago • 3 comments

Currently the loader uses ES2015 import and export default. Are you interested in adding options to allow for Node.js module require and module.exports? If so, I could work on a PR.

davidtheclark avatar Jun 11 '17 17:06 davidtheclark

I’d been making moves towards this by making the formatters pretty generic. I could see a future where the API includes the ability to override them, and/or includes versions for each module style.

As an aside, do recent versions of Node handle spread syntax? It’s been a while since I checked! :)

ticky avatar Jun 11 '17 18:06 ticky

do recent versions of Node handle spread syntax

For Array spreads, looks like there's support in 4 with a flag and then full support in 5+.

For Object spreads, looks like only 8+ with a flag.

I’d been making moves towards this by making the formatters pretty generic.

Yeah, I think that structure will make the change straightforward. I can try to work out a PR today.

davidtheclark avatar Jun 11 '17 18:06 davidtheclark

Cool! Sounds good to go ahead with keeping, then!

ticky avatar Jun 11 '17 21:06 ticky