Closed flo-pereira closed 2 years ago
I believe .env files are loaded from the root that is specified in the vite.config.ts
file. In all the examples, I set that to src/
. Check if your config specifies a root, and try putting the .env files there.
Oh sorry, I misread your issue. It's a problem with content scripts, not with loading .env files. I'm busy right now, I'll get back to you in a bit
You were right, that was just a problem with my root dir, sorry for that ! :pray:
however, there is an issue that the .env file have to be in the root
dir, seems that it doesn't take envDir
path.
got it
libModeViteConfig: {
envDir: __dirname,
}
Hi,
Is there a way to get env variables from
.env
in content_script ?.env
vite.config.ts
content_script.ts
Thanks