-
-
Notifications
You must be signed in to change notification settings - Fork 69
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
feat: add typescript support for vite
and vite-node
#346
Conversation
NOTES:
|
Woops, I might have broken something! As the tests are failing for the Node.js I'm not knowledgeable enough to understand if this test is strictly related to the changes I implemented. As far I understood the code, and the fact that I'm only using the |
I was able to reproduce the issue locally. The fix is to upgrade |
I'm ok in dropping Node v14 and v16 with this PR, but it should still support Node v18. |
Once I'll have a free time, I'll sit on this issue again and will think about how to write a test for this one. If you have any hints, I'll be grateful! Important Important note as well, in case I forget again in the future. NODE_OPTIONS="--loader=tsx" vite |
I'm ok to ship a new major and support v18.19+. |
See e.g.https://github.com/fastify/fastify-autoload/pull/280/files for implementing a test But if you can provide an example repo where you use vite and node-vite and your fork to load your vite and node-vite code, I could add the test to this PR. |
UpdateFirstly, thank you for you patience, as the Lunar New Year is almost here, I finally have time to finish unresolved matters. ✅ So, I've managed to add test for when running with ❌ However, I'm unable to configure tests properly for building via RollupError: "dirname" is not exported by "__vite-browser-external" I've tried to do a lot of manipulation via So, if the test is really mandatory for using with |
Well, the goal was to support What's the |
Okay, I didn't want to give up on this so easily after all. I know the error message seems like as I was trying to build for browser, while I used the So, today with fresh mind, I attempted again to write tests for The missing link was that I was not using the RollupError: "default" is not exported by "index.js", imported by "test/typescript/basic/app.ts". So, I knew I had to modify the And voila, it worked ✅. So, to summarize:
In the end, I think using |
CI is failing |
I need help with this one. By default I am using So, I reinstalled the project dependencies by using What helped was adding the flag npm i --ignore-scripts --legacy-peer-deps Not sure how else I can fix it, and I'd rather to not modify the |
Apparently vite-plugin-node requires vite v4.0.0: https://github.com/axe-me/vite-plugin-node/blob/b9ff47f6f02b4ffd4648812a3de6d5d133879ac6/packages/vite-plugin-node/package.json#L41 I think you can set legacy-peeer-deps in the |
Closing due to inactivity. |
Resolves #226
Checklist
npm run test
andnpm run benchmark
and the Code of conduct