Closed blcyzycc closed 1 month ago
npm run build --mode test
wrong
npm run build -- --mode test
right
copy the env to . production then build success just because vite read the right env: the mode config do not pass to vite then it read default mode.
Hello @blcyzycc. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs reproduction
will be closed if they have no activity within 3 days.
npm run build --mode test
wrongnpm run build -- --mode test
rightcopy the env to . production then build success just because vite read the right env: the mode config do not pass to vite then it read default mode.
okay, thanks
Describe the bug
打包错误提示如下: error during build: Error: An entry point is required in the electron vite main config, which can be specified using "build.lib.entry" or "build.rollupOptions.input".
将.env.test文件中的配置复制到 .env.production 中,发现能打包成功。
Reproduction
未上线
Steps to reproduce
npm run build:winTest
System Info
Used Package Manager
npm
Logs
error during build: Error: An entry point is required in the electron vite main config, which can be specified using "build.lib.entry" or "build.rollupOptions.input". at configResolved (file:///D:/JXW/dpds/Electron-App-Vite-Demo/node_modules/electron-vite/dist/chunks/lib-BmEkZIgk.mjs:335:27) at file:///D:/JXW/dpds/Electron-App-Vite-Demo/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:66698:67 at Array.map ()
at resolveConfig (file:///D:/JXW/dpds/Electron-App-Vite-Demo/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:66698:53)
at async build (file:///D:/JXW/dpds/Electron-App-Vite-Demo/node_modules/vite/dist/node/chunks/dep-CzJTQ5q7.js:65530:18)
at async build (file:///D:/JXW/dpds/Electron-App-Vite-Demo/node_modules/electron-vite/dist/chunks/lib-D1n7TA6K.mjs:26:13)
at async CAC. (file:///D:/JXW/dpds/Electron-App-Vite-Demo/node_modules/electron-vite/dist/cli.mjs:83:9)
Validations