如何使用angular-cli从角度构建中排除文件。我只是在tsconfig.json
和tsconfig.app.json
文件中添加要排除的路径,但是当我运行ng serve
时,角度依然试图编译这些文件。从Angular 2中构建排除文件
任何想法?
如何使用angular-cli从角度构建中排除文件。我只是在tsconfig.json
和tsconfig.app.json
文件中添加要排除的路径,但是当我运行ng serve
时,角度依然试图编译这些文件。从Angular 2中构建排除文件
任何想法?
使用的tsconfig.json
exclude
财产,即:
"exclude": [
"node_modules",
"**/*.spec.ts"
]
您可以使用ng eject
得到webpack.config.js。您可以根据需要进行修改。但是,在此之后,您将无法使用ng serve
或ng build
。
要再次使用这些命令,您必须修改.angular-cli.json
。删除属性'projects.ejected'或将其设置为false。 How to undo Angular 2 Cli ng-eject
这就是我试过但它仍然试图编译打字稿文件 –
什么打字稿文件? –
我在文件夹中有一些打字稿,但我不想编译它们。 –