-
Notifications
You must be signed in to change notification settings - Fork 44
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 ESM support to the build #135
Comments
I think |
Thanks for heads-up. Just out of my curious, could you give your concrete example using ESM? The most of use-case of require/import this plugin is Node env, I think but you're playing with something new? |
Sorry for the delay! This may very well be an unusual use case right now, I'm using the plugin with SvelteKit which is built on top of Vite. SvelteKit uses their own I can import import viteMd from 'vite-plugin-markdown'
// used in config plugins array
viteMd.plugin({ mode: viteMd.Mode.HTML }) but ideally I'd like to be able to use a more normal import format along the lines of import { plugin: markdown, Mode } from 'vite-plugin-markdown'
// used in config plugins array
markdown({ mode: Mode.HTML }) Local reproI tested it out locally and I was able to update the plugin's I can clean my local changes up and submit a PR if you're interested 👍 |
Thanks for the detail. Due to my default is always TypeScript, I didn't care about CJS ways much honestly 😂 We can write as
I appreciate your generous offer, but I'm good. I'd like to consider ideal build pipelines (leaning toward to |
It'd be great to see ESM module support added now that it's stable in node 15.
This plugin has been super convenient on a site I'm testing SvelteKit with. They just recently switched the config file format for SvelteKit projects from commonjs to esm, I'm assuming ViteKit and others will start moving that way now that node supports it.
The text was updated successfully, but these errors were encountered: