Comments (7)
from vite-electron-plugin.
Hey, thanks for the quick reply.
That piece of code is there by default, and in my case it's also there, but doesn't seem to expose environment variable or make import.meta.env typed
from vite-electron-plugin.
Not a clear requirement, can you provide a simple reproduction Demo?
from vite-electron-plugin.
Not a clear requirement, can you provide a simple reproduction Demo?
https://github.com/treboryx/electron-vite-reproduction
Check electron/main/index.ts
line 16 & 17. Run it and it'll log undefined values.
from vite-electron-plugin.
- console.log("process.env", process.env.TEST_ENV);
+ console.log("import.meta.env", import.meta.env.TEST_ENV);
from vite-electron-plugin.
- console.log("process.env", process.env.TEST_ENV); + console.log("import.meta.env", import.meta.env.TEST_ENV);
Oops, that was a typo but it still doesn't work.
from vite-electron-plugin.
https://vitejs.dev/config/shared-options.html#envprefix
- TEST_ENV=true
+ VITE_TEST_ENV=true
from vite-electron-plugin.
Related Issues (20)
- Application entry file "dist-electron\main\index.js" in the "D:\PhpstormProjects\vite-electron-plugin\release\0.0.0\win-unpacked\resources\app.asar" does not exist. HOT 1
- build失败entry file does not exist HOT 8
- tsc failed to check: Property 'electronApp' does not exist on type 'Process' HOT 5
- imported method (main process) is undefined HOT 5
- feature request: be able to bundle preload script HOT 2
- [help] 设置alias后找不到ts模块 HOT 2
- 建议npm包的`package.json` 里的 `types` 不要使用 `src` 目录 HOT 1
- Missing package after building HOT 2
- 打包后图片资源文件路径不正确 HOT 1
- incorrect config path in `electron-env.d.ts ` causes emitDeclaration to fail HOT 1
- electronforge HOT 1
- How to change location of electron main process code? HOT 1
- Cannot use global variables replacements in electron HOT 1
- Building does not bundle dependencies HOT 6
- Change in acorn package now causes syntax errors when using the alias plugin HOT 4
- Error not a directory app.asar/out/main/node_modules/langchain when open the application after built HOT 1
- Did this plugin change to vite-plugin-electron? HOT 3
- TypeScript Decorators Not Compiling Correctly Despite experimentalDecorators Enabled
- there are zombie process when change code of main process and hot reload
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vite-electron-plugin.