-
Notifications
You must be signed in to change notification settings - Fork 61
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
Support TS/JSX inside node_modules #53
Comments
Hi, I checkout the repo and tried it to migrate to SWC. I got another issue about cannot resolving react. This make sense because it's used inside your main project without having it as a dev-dependency. Adding react & react-dom as dev-deps works. |
not sure what do you mean by
|
I mean adding dev dependency here: https://github.com/oedotme/generouted/blob/main/packages/generouted/package.json |
Not sure if that fixed the issue with Glob, but i'm still having the main issue with the latest package. Vite: v4.1.4 |
Can you provide a minimal repro? |
Sure, here you go :) Repro link |
Thanks for the repro. |
Can you mention the patch for it? I tried optimized deps, but it didn't seem to work. |
You need to This might be something that change in the future, I need to look on how it plays with deps prebundling (on the repo it seems that the file is not part of dependencies pre-bundling) |
Can you be a bit more specific about the patch fix? |
You need to find this line in the compiled version (cjs or mjs depending on your package.json): https://github.com/vitejs/vite-plugin-react-swc/blob/main/src/index.ts#L154 |
any way to get this into the plugin instead of having to patch it? |
I believe this plugin should accept It's a very common pattern found in a lot of rollup plugin packages but I do not know your philosophy on adding optionality. Would this be a good solution @ArnaudBarre ? If so I am able to create the PR to support this as its a feature I am looking for. |
For now the philosophy of this plugin is to limit to options and support common future proof pattern out of the box. For example mdx is supported by default. We will discuss it with the team this Thursday to see if this is a pattern that should be encouragd and maybe better supported by the core (the same question applies for |
Fixed in 4b9b2d5. Note that for now this not supported by TS and errors from these files cannot be silenced if the user is using a stricter configuration than the library author: microsoft/TypeScript#30511. I advise to use it only for internal libraries for now. |
[plugin:vite:import-glob] Invalid glob import syntax: Expect CallExpression, got BinaryExpression
How to reproduce-
The text was updated successfully, but these errors were encountered: