Open Verthon opened 4 months ago
Hello
I run into following issue: RollupError: Unexpected token@. Expected identifier, string literal, numeric literal or [ for the computed key when running build with the Vite
RollupError: Unexpected token
. Expected identifier, string literal, numeric literal or [ for the computed key
Dependencies:
Decorator usage:
function log< Type, Context extends ClassMethodDecoratorContext | ClassFieldDecoratorContext, ReturnType >(message: Type): (_: unknown, context: Context) => ReturnType { //@ts-ignore return (_, context) => { if (context.kind === "method") { return () => message; } return () => () => message; }; } export class Example { @log("test") public doSomething = () => { console.log("test"); }; }
Reproduction repository: https://github.com/Verthon/babel-plugin-decorators-repro
Current workaround:
we are using @vitejs/plugin-react even we don't use React 😅 but it works
@vitejs/plugin-react
react({ babel: { plugins: [ ['@babel/plugin-proposal-decorators', { version: '2023-05' }], ], }, }),
Hello
I run into following issue:
RollupError: Unexpected token
@. Expected identifier, string literal, numeric literal or [ for the computed key
when running build with the ViteDependencies:
Decorator usage:
Reproduction repository: https://github.com/Verthon/babel-plugin-decorators-repro
Current workaround:
we are using
@vitejs/plugin-react
even we don't use React 😅 but it works