Closed hassanzohdy closed 1 year ago
Are you bundling the code of the plugin into another plugin?
@ArnaudBarre no, i'm using both plugins in a react project.
Yeah so I will need a repro because from the error it seems that the code is not running in node_modules/@vitejs/plugin-react-swc
I generated new vite project and imported two plugins, here is the repo for this project https://github.com/hassanzohdy/vite-react-swc.
The issue is here: https://github.com/hassanzohdy/mongez-vite/blob/63443ae2a1e8daa933b5525c13cb3e87169e76e7/src/generateHtaccess.ts#L11
You should not override a global with a specific meaning like __dirname (and set it to a static value instead of a dynamic one)
Hello,
I'm trying to use "@vitejs/plugin-react-swc" plugin but it has a conflict with another plugin that i already developed, you can check its source code here https://github.com/hassanzohdy/mongez-vite.
The issue is that the rswc plugin is trying to resolve "refresh-runtime.js" from the path of my package.
When i start the project, i receive the following error:
I made some investigations with
index.mjs
, i tried to log the load resolver with the following code:The output of these console logs:
I'm not really sure why the conflict happens with my plugin, but what i can only think of, in the plugin i inject
tsconfig.json
path aliases to vite, maybe this what reflects on it.Package version: 3.3.0 Vite version: 4.3.2
vite.config.ts contents:
P.S: my plugin works fine with @vitejs/plugin-react plugin but i'm not really sure why it does not with swc plugin.
Thanks.