-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
[Feature]:Babel plugin support #320
Comments
I don't feel that are the same category of plugins, how do you expect it to work? |
We don't necessarily need to be compatible with unplugin devlope system like Take your import insertImport from './insert'
export const unplugin = createUnplugin((options: UserOptions) => {
return {
name: 'auto-import',
transformInclude(id) {
return id.endsWith('.ts')
},
transform(code) {
return insertImport(code)
},
babel: {
visitor: {
Identifier(path, { opts: options, file }) {
let { node: identifier, scope } = path;
let { declarations } = options;
let filename = file.opts.filename
? basename(file.opts.filename)
: "";
declarations.some(handleDeclaration, {
path,
identifier,
filename,
});
},
handleDeclaration(declaration) {
insertImport(declaration);
return true;
}
}
},
}
} |
@SnowingFox IMHO this is out-of-scope... |
Yeah. As |
Describe the feature
In some case, like React Native devlopment, it should use
babel
instead ofwebpack
,vite
..., so it's necessary to support babel plugin devlopment in unplugin.Do you have any plan for this feature?
Additional information
The text was updated successfully, but these errors were encountered: