Watching for changes & Typescript
See original GitHub issueHi,
As this is the recommended way to run functions locally, is there a way to use Typescipt and to watch files?
Thanks,
Expected Behaviour:
Running functions-framework --watch
would restart the functions framework if any of the *.js files in the app (eg the main index.js and it’s dependancies) change
Actual Behaviour: New feature
Steps to Reproduce the Problem New feature
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:13 (3 by maintainers)
Top Results From Across the Web
Documentation - Configuring Watch - TypeScript
Compiler supports configuring how to watch files and directories using compiler flags in TypeScript 3.8+, and environment variables before that.
Read more >How to watch and compile all TypeScript sources?
Run the compiler in watch mode. Watch input files and trigger recompilation on changes. The implementation of watching files and directories can ...
Read more >Watch for Object Changes with JavaScript by Typescript · GitHub
Watch for Object Changes with JavaScript by Typescript · GitHub. Instantly share code, notes, and snippets.
Read more >tsc-watch - npm
tsc-watch starts a TypeScript compiler with --watch parameter, with the ability to react to compilation status. tsc-watch was created to ...
Read more >3 ways to watch and run your TypeScript projects
... the project on every code change?” TypeScript has evolved greatly in the last few years, but running the project after building in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I just use
Based on @QuantumInformation’s excellent answer, we’ve ended up using the following:
Then just
npm run dev
.Bonus: If you want to add the typescript source files to a different folder
/app
, then:"outDir": "./dist"
and"rootDir":"./app"
"main":"./dist/index.js"