Home > database >  Ignore .npmrc File on Build Definition on Azure DevOps
Ignore .npmrc File on Build Definition on Azure DevOps

Time:09-22

My application uses Angular 2.4 and I want to ignore .npmrc file on the build on Azure Devops. I am not sure whether to ignore it on tgconfig.json file or on the build pipeline itself. But I tried to exclude this .npmrc file on tgconfig.json file like this:

{
  "compilerOptions": {
    "moduleResolution": "node",
    "target": "es5",
    "sourceMap": true,
    "experimentalDecorators": true,
    "emitDecoratorMetadata": true,
    "skipDefaultLibCheck": true,
    "removeComments": true
  },
  "exclude": [
    "node_modules",
    "wwwroot/dist",
    ".npmrc"
  ]
}

But the build on azure devops still does not ignore it. And here's the build definition: enter image description here

CodePudding user response:

you can add a step to delete the file before processing.

bash: |
  rm $(Build.SourcesFolder)/.npmrc
  • Related