Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tenpamk2/esbuild-typescript-vscode-template
π° The esbuild & TypeScript template for debugging by VSCode π°
https://github.com/tenpamk2/esbuild-typescript-vscode-template
Last synced: about 2 months ago
JSON representation
π° The esbuild & TypeScript template for debugging by VSCode π°
- Host: GitHub
- URL: https://github.com/tenpamk2/esbuild-typescript-vscode-template
- Owner: tenpaMk2
- License: mit
- Created: 2024-04-12T13:00:32.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-04-12T14:20:24.000Z (9 months ago)
- Last Synced: 2024-04-12T22:15:34.821Z (9 months ago)
- Language: TypeScript
- Size: 88.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# esbuild-typescript-vscode-template
π° The esbuild & TypeScript template for debugging by VSCode π°
## π How to build
Install requirements including `esbuild` .
```sh
npm install
```Build the sample TypeScript source.
```sh
npm run build
```It will generate `dist/index.cjs` .
Run output.
It execute `node dist/index.cjs` .```sh
npm run exe
```## π΄ How to debug by VSCode
### Recommended: auto-build
Start watching.
```sh
npm run watch
```It will automatically generate the output for every file change.
Set breakpoints anywhere you like.
Press `F5` ( `Debug: continue` ).
It launch `"Launch Program"` in `.vscode/launch.json` .If it will stop at the breakpoints, the setup is completed.
![sample break points](./images/sample-break-points.png)
### Not recommended: manual-build
Enable the comment-outed lines in `.vscode/launch.json` .
```json
// Enable if you don't use `watch` mode.
// "preLaunchTask": "npm: build-debug",
```It will execute the build task for each debug ( `F5` ).
This method does not use `watch` mode of esbuild.
This would be useful in some cases. For example, cases where you want to control the build timing.## π Appendix: Application to Node single executable applications
[Node single executable applications](https://nodejs.org/api/single-executable-applications.html)
can use only single JavaScript file.
It cannot use multiple JavaScript files.
And of course, it cannot use the npm packages...Bundlers can solve this problem by bundle the multiple JavaScript files and npm packages into a single file.
`esbuild` also bundle multiple TypeScript files and npm packages into single JavaScript fileβThis repository helps development of single executable applications by making debug easyβ