forge
forge copied to clipboard
create-electron-app with --template=typescript does not properly setup package.json scripts
Preflight Checklist
- [x ] I have read the contribution documentation for this project.
- [x ] I agree to follow the code of conduct that this project follows, as appropriate.
- [x ] I have searched the issue tracker for a bug that matches the one I want to file, without success.
Issue Details
-
Electron Forge Version:
- 6.14.6
-
Operating System:
- Windows 10
Expected Behavior
I expect that npx create-electron-app my-new-app --template=typescript
sets up a ready to start project which will allow me to start, package and make the template app.
Actual Behavior
The typescript compiler (tsc) does not run before "npm run package" and "npm run make" resulting in the app bundle not including the required .js files to run the app.
To Reproduce
- Run npx create-electron-app my-new-app --template=typescript
- cd my-new-app
- npm run package or npm run make
Go to /out and try to run the app.
Additional Information
The cause for this that the template adds the tsc only to the "start" script and not on "package" and "make"
"start": "tsc && electron-forge start",
"package": "electron-forge package",
"make": "electron-forge make"
So ideally, instead of limiting the running of tsc
to the npm scripts, I'd like it to be run via a default Electron Forge hook (written in JavaScript), packageAfterCopy
. I can go into more detail later.
No longer relevant since https://github.com/electron/forge/pull/2948?