打字稿副本文件 [英] Typescript copy-files

查看:83
本文介绍了打字稿副本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,我有一个 src 和一个 dist 文件夹。在 src 中是所有ts,json和css文件。

In my project I'm having a src and a dist folder. In src are all the ts, json and css files.

在tsconfig中,我将outDir指定为 dist 。是否知道是否也可以将所有json和css文件也复制到dist文件夹(例如在带有--copy-files参数的Babel中)?

In the tsconfig I specified the outDir to be dist. Is it know possible to copy all the json and css files also to the dist folder (like in Babel with the --copy-files parameter)?

推荐答案

不可能。 Typescript的理念是做一件事,做好事。只能将Typescript转换为Javascript。该项目还拒绝了添加源代码格式控件的请求,因为还有其他工具可以更好地处理该问题。这意味着如果您需要进行转译之外的任何事情,那么您将需要一个工作流来处理其他功能/需求。

It is not possible. Typescript's philosophy is to do one thing and do it well. This is relegated to transpiling Typescript to Javascript. The project has also denied requests to add source code formatting controls because there are other tools that handle that better. What this means is that if you need anything outside of transpiling, you will need a workflow to handle the other functionality/needs.

这篇关于打字稿副本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆