unimport icon indicating copy to clipboard operation
unimport copied to clipboard

Support for Astro JS

Open virketrang opened this issue 2 years ago • 1 comments

Describe the feature

I have tried using unimport with Astro JS. The plugin works perfectly well in .js(x)- and .ts(x)-files, but not in .astro-files. It simply says X is not defined. I have tried investigating the issue, but I have been unable to find and explanation thus far. Maybe someone else will be able to implement a solution.

Additional information

  • [X] Would you be willing to help implement this feature?

virketrang avatar Nov 25 '23 11:11 virketrang

You can just configure the include option to add .astro:

https://github.com/unjs/unimport/blob/b1f1d33d6a26e16857315818e84b6f345e12ef0d/src/unplugin.ts#L9-L23

antfu avatar Nov 25 '23 12:11 antfu