Closed caoxiemeihao closed 2 weeks ago
let's merge this bad boy
PTAL @electron/forgers
@caoxiemeihao can you explain the changes you’ve made to the type declarations code?
hey, this pr removed the vite-forge type declarations in forge.env.d.ts
which were broken because the actual declarations file wasn't present in @electron-forge/plugin-vite/forge-vite-env
for some reason
i think the packaging process is not including the forge-vite-env.d.ts
file for some reason
i added the file and now the reference /// <reference types="@electron-forge/plugin-vite/forge-vite-env" />
in forge.env.d.ts
seems to be working correctly
ah looks like the vite const type declarations were fixed in https://github.com/electron/forge/commit/3ad74852700970f06955799f4508fc7bcb86c3f2 but haven't been released yet which fixed the forge-vite-env.d.ts
issue
Summarize your changes:
Closes #3714
Since we removed the copy
dependencies
logic in vite-plugin ofv7.5.0
, this will causeif (require('electron-squirrel-startup'))
to fail to load. This is because Vite's built-in@rollup/plugin-commonjs
cannot handle CommonJS'srequire()
function like Webpack in many cases. We need to make some compromises in code writing and try to use ESModule'simport
statement to avoid this problem.