设置角度cli生产构建tfs [英] Setup angular cli production build tfs

查看:100
本文介绍了设置角度cli生产构建tfs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在本地我的项目可以使用ng build --prod很好地构建,但是如果我使用以下Powershell脚本在tfs(团队基础服务器)上进行设置,则会失败,并出现一些错误.

Locally my project builds fine with ng build --prod but if I set it up on tfs (team foundation server) with the following powershell script it fails with some errors.

ps脚本:

npm install
npm run ng build --prod

tfs构建输出:

  • [1m [33mWARNING in ./~/css-loader?{"sourceMap":false,"importLoaders":1}!./~/postcss-loader!./~/sass-loader!./src/scss/style.scss

  • [1m[33mWARNING in ./~/css-loader?{"sourceMap":false,"importLoaders":1}!./~/postcss-loader!./~/sass-loader!./src/scss/style.scss

autoprefixer:D:\ a \ 1 \ s \ src \ scss \ style.scss:7468:3:将过渡属性替换为过渡,因为Autoprefixer不支持过渡属性和其他过渡的任何情况-* @ ./src/scss/style.scss 4:14-203 2017-04-30T07:17:51.9419669Z @多./~/primeng/resources/themes/bootstrap/theme.css ./~/primeng/resources/primeng.min.css ./~/font-awesome/css/font-awesome.css ./src/scss/style.scss[39m[22m

autoprefixer: D:\a\1\s\src\scss\style.scss:7468:3: Replace transition-property to transition, because Autoprefixer could not support any cases of transition-property and other transition-* @ ./src/scss/style.scss 4:14-203 2017-04-30T07:17:51.9419669Z @ multi ./~/primeng/resources/themes/bootstrap/theme.css ./~/primeng/resources/primeng.min.css ./~/font-awesome/css/font-awesome.css ./src/scss/style.scss[39m[22m

[错误] 0%编译10%构建模块0/1模块1个活动多D:\ a \ 1 \ s \ src \ main.ts

[error] 0% compiling 10% building modules 0/1 modules 1 active multi D:\a\1\s\src\main.ts

[错误]进程已完成,退出代码为0,并且有3个错误被写入错误流.

[error]Process completed with exit code 0 and had 3 error(s) written to the error stream.

推荐答案

现在可以正常工作,我删除了powershell脚本,并在构建过程中添加了单独的任务.

It works now, I removed the powershell script and added seperate tasks in the build process.

  • npm install(标准安装)
  • npm install -g @ angular/cli(命令行)
  • ng build --prod(命令行)

根据评论进行更新:

您还可以使用:npm run ng build---prod.这样,您不必安装angular/cli.

You can also use: npm run ng build -- --prod. This way you don't have to install angular/cli.

这篇关于设置角度cli生产构建tfs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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