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

Add @babel/plugin-proposal-decorators to transform #27

Closed
LukeCSamuel-RV opened this issue Apr 1, 2021 · 3 comments
Closed

Add @babel/plugin-proposal-decorators to transform #27

LukeCSamuel-RV opened this issue Apr 1, 2021 · 3 comments

Comments

@LukeCSamuel-RV
Copy link
Contributor

We make a lot of use of Typescript decorators in our code base. In Nuxt 2.14 they could be used in places outside of webpack module resolution, such as Nuxt modules. In Nuxt 2.15 they are no longer supported, because the babel instance bundled with Jiti doesn't have the @babel/plugin-proposal-decorators plugin.

I would propose that if opts.ts and ideally only when experimentalDecorators === true (from tsconfig), this plugin be added: _opts.plugins!.push([require('@babel/plugin-proposal-decorators'), { legacy: true }])

@pi0
Copy link
Member

pi0 commented Apr 1, 2021

Hi @LukeCSamuel-RV. Thanks for issue it makes sense adding for typescript. Would you please open a pull request?

@tobiasdiez
Copy link

Could babel-plugin-transform-typescript-metadata also please be added so that the metadata added by these decorators can be used, say for dependency injection.

This would fix nuxt/typescript#494.

@NexZhu
Copy link

NexZhu commented Jun 2, 2022

@jozsefsallai Could you please open a PR to add babel-plugin-transform-typescript-metadata?

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

4 participants