I currently have a build definition in place to build my project and publish my files for release. My project relies on a bit of NPM to do some automation using Gulp.js. I dont need it for anything else once my gulp-tasks have run.
When I get to my publish artifacts
step, it publishes all of the files in the node_modules
directory even though I don't even have them in my repo. I was wondering if there was a way to exclude them from within the contents section or if anyone else has a better idea?
Here is my Publish Artifacts settings:
In the Contents section, I also tried:
**\*
!**\node_modules\*
I am pretty new with the Build & Release process and I am unsure what other information might be needed to help debug this issue. So please comment and I can include information as needed. Thanks!
The node_modules folder contains every installed dependency for your project. In most cases, you should not commit this folder into your version controlled repository. As you install more dependencies, the size of this folder will quickly grow. Furthermore, the package-lock.
The node_modules folder is used to save all downloaded packages from npm in your computer for the JavaScript project that you have. Developers are always recommended to do a fresh install with npm install each time they downloaded a JavaScript project into their computer.
Since Copy and Publish Build Artifacts task is deprecated now, you’d better use Copy Files task and Publish Build Artifacts task instead. And these two tasks can help you exclude node_modules
folder from publishing to server. Detail settings as below:
Source Folder: $(Build.SourcesDirectory)
Contents:
**\**
!**\node_modules\**
Target Folder: $(build.artifactstagingdirectory)
Publish Build Artifacts task: $(build.artifactstagingdirectory)
Artifact Name: drop
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With