简体   繁体   English

TypeScript编译的Javascript文件的命名模式

[英]Naming pattern for TypeScript compiled Javascript files

We recently created a Repository for a TypeScript project. 我们最近为TypeScript项目创建了一个存储库。 We try to .ignore all generated files to keep our repository and build processes clean. 我们尝试.ignore所有生成的文件,以保持我们的存储库和构建过程的清洁。

Currently our TypeScript files someFile.ts are compiled to JavaScript files someFile.js . 当前,我们的TypeScript文件someFile.ts被编译为JavaScript文件someFile.js We would like to ignore all compiled files. 我们想忽略所有编译文件。 However, there are javascript files which we would like to track in our repository. 但是,我们希望在我们的存储库中跟踪javascript文件。 This makes it impossible to simply ignore all src/**/*.js files. 这使得不可能简单地忽略所有src/**/*.js文件。

Is there a way to add a prefix or postfix or other naming adjustment to the compiled javascript files as a compileOption? 有没有办法将前缀或后缀或其他命名调整作为compileOption添加到已编译的javascript文件? Something like file.compiled.js ? file.compiled.js一样?

From the docs: http://www.typescriptlang.org/docs/handbook/compiler-options.html 从文档中: http : //www.typescriptlang.org/docs/handbook/compiler-options.html

You could use --listEmittedFiles and save the list of compiled files to .gitignore 您可以使用--listEmittedFiles并将已编译文件的列表保存到.gitignore

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM