If you want to reload the changes to your TypeScript when running firebase serve
or firebase functions:shell
, all you have to do is build your project again using npm script that was created for you when you initialized the project (see package.json):
(如果要在运行firebase serve
或firebase functions:shell
时将更改重新加载到TypeScript中,您要做的就是使用初始化项目时为您创建的npm脚本再次构建项目(请参阅package.json):)
cd functions
npm run build
This will transpile your TypeScript to JavaScript, and the changes to the JavaScript will get picked up by the emulator automatically.
(这会将您的TypeScript转换为JavaScript,并且仿真器会自动提取对JavaScript的更改。)
Also, if you are a more advanced TypeScript user, you can run tsc --watch
to automatically compile TS to JS when source files change on disk.
(另外,如果您是TypeScript的高级用户,则可以在源文件在磁盘上更改时运行tsc --watch
自动将TS编译为JS。)
You can read more about that in this blog . (您可以在此博客中了解有关此内容的更多信息。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…