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

[ question ] compatibility in projects built by vite #413

Closed
ZHan-F opened this issue Feb 18, 2023 · 3 comments
Closed

[ question ] compatibility in projects built by vite #413

ZHan-F opened this issue Feb 18, 2023 · 3 comments

Comments

@ZHan-F
Copy link

ZHan-F commented Feb 18, 2023

Hi
I follow the docs and try to use @deepkit/type in my vue3 project built by vite , it doesn't work even replicating the scenario in the docs .
Error screenshot :
error

But in project built with vue-cli , it works correctly.

So I want to ask , it cannot work with vite or the docs has something not mentioned ?
hope to get your reply

@marcj
Copy link
Member

marcj commented Feb 18, 2023

Vite uses esbuild (alternative TypeScript compiler), right? If so, then Deepkit is not supported. Deepkit requires the official TypeScript compiler (tsc), so if you can get Vite to work with tsc, then Deepkit will work fine.

@ZHan-F
Copy link
Author

ZHan-F commented Feb 18, 2023

Thank you for your reply .
Your project has given me great inspiration , I will use it in the next project .
Wish you all the best

marcj added a commit that referenced this issue May 6, 2023
@marcj
Copy link
Member

marcj commented May 8, 2023

Vite is now supported via @deepkit/vite,

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react-swc'
import { deepkitType } from "@deepkit/vite";

// https://vitejs.dev/config/
export default defineConfig({
    plugins: [react(), deepkitType()],
})

see example repository here: https://github.com/marcj/typescript-react-dependency-injection

@marcj marcj closed this as completed May 8, 2023
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