Setting up angular build cli tfs

Locally my project builds fine with ng build -prod, but if I set it up to tfs (command foundation server) with next version of powershell script it fails with some errors.

ps script:

npm install
npm run ng build --prod

      

tfs output:

  • [1m [33mWARNING c. / ~ / 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: replace the transition property with a transition because Autoprefixer cannot 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]

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

  • [error] Process terminated with exit code 0 and has 3 error (s) written to the error stream.

+3


source to share


3 answers


Now it works, I removed the powershell script and added separate tasks to the build process.

  • npm install (standard)
  • npm install -g @ angular / cli (command line)
  • ng build --prod (command line)


Update based on comment:

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

+11


source


I did the same as with the marked answer, but it bothered me that it always sets angular-cli globally every time. So I just switched it to something like this:

node $(Build.SourcesDirectory)/node_modules/@angular/cli/bin/ng build --prod -op $(Build.BinariesDirectory) -v

      



now after npm installs all the depics it will install the cli as well and then just use that.

+2


source


Add npm ( Add Task >> Package >> npm

) task with below configuration

enter image description here

0


source







All Articles