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

Support for Astro JS #299

Open
1 task done
virketrang opened this issue Nov 25, 2023 · 1 comment
Open
1 task done

Support for Astro JS #299

virketrang opened this issue Nov 25, 2023 · 1 comment

Comments

@virketrang
Copy link

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

  • Would you be willing to help implement this feature?
@antfu
Copy link
Member

antfu commented Nov 25, 2023

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

export interface UnimportPluginOptions extends UnimportOptions {
include: FilterPattern
exclude: FilterPattern
dts: boolean | string
/**
* Enable implicit auto import.
* Generate global TypeScript definitions.
*
* @default true
*/
autoImport?: boolean
}
export const defaultIncludes = [/\.[jt]sx?$/, /\.vue$/, /\.vue\?vue/, /\.svelte$/]
export const defaultExcludes = [/[\\/]node_modules[\\/]/, /[\\/]\.git[\\/]/]

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