Skip to content

Latest commit

 

History

History
30 lines (18 loc) · 827 Bytes

File metadata and controls

30 lines (18 loc) · 827 Bytes

Vite + SWC does not support decorators

You can follow many threads explaining about that.

But you can use the solution without decorators.

import { BaseEntity } from "@guildadev/jsonapi-to-model";

export class User extends BaseEntity {
  get name() {
    return this.getAttribute("name");
  }
}

You can check the preview link on README.md

References

vitejs/vite#15565

evanw/esbuild#257 (comment)

vitejs/vite#4884 (comment)

https://vitejs.dev/guide/migration#update-experimentaldecorators-and-usedefineforclassfields-typescript-behaviour

https://github.com/dkent600/douglaskent/commit/a73a3ec9b75122e074ef555606fff2e2fed6672c#diff-6a3b01ba97829c9566ef2d8dc466ffcffb4bdac08706d3d6319e42e0aa6890dd