Commit fc70940
authored
build(vite): emit powerpoint-bridge.ps1 into out/main (#62)
The viteStaticCopy target for the PowerShell bridge had stopped emitting
anything. Two independent faults, each producing the same silent no-op:
1. vite-plugin-static-copy v4 added an `environment` option defaulting to
`client`, and its build plugin returns early when the name does not match.
electron-vite builds the main process in Vite's `ssr` environment, so the
writeBundle hook never ran and no copy line was logged. The target was
added in 38de84e against ^3.1.4 and broke on the bump to ^4.1.1.
2. `dest` reproduces the matched path's directory segments underneath itself,
so even once the hook ran the file landed in out/main/src/main/pptx/ rather
than out/main/. `rename: { stripBase: true }` flattens it.
This matters because src/main/pptx/windows-powershell.ts walks a list of
candidate paths for the bridge, and its `path.join(__dirname, ...)` entry
points at out/main/. That candidate has been dead since the bump, so dev and
`electron-vite preview` runs on Windows were falling through to the
`src/main/pptx/...` relative candidates, which resolve only by accident of the
working directory. Packaged builds were never affected - they resolve via
process.resourcesPath, populated from build.extraResources - which is why this
is fixed rather than deleted.
Also removes forge.config.ts. Every packaging script invokes electron-builder
and release.yml calls dist:mac / dist:win, so it described a setup the project
does not use. It was inert rather than merely redundant: no @electron-forge/*
package appears in package-lock.json, so its imports were unresolvable, and
tsconfig.json includes only src/**/*, so typecheck never read it. A leftover of
TODO.md's "Phase 11: Packaging", which specified Forge before the project
settled on electron-builder.
The bridge now also ships in the npm tarball, consistent with the `out/**`
allowlist added in #59.1 parent 9e77f3b commit fc70940
2 files changed
Lines changed: 14 additions & 44 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
13 | 21 | | |
14 | 22 | | |
15 | 23 | | |
16 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
17 | 30 | | |
18 | 31 | | |
19 | 32 | | |
| |||
This file was deleted.
0 commit comments