0

Within Visual Studio 2015 for .NET Core Web Application-

With Gulp I’m trying to Move specific packages that were created with the NPM Package Manager.

I installed jQuery 1.11.3 with NPM: npm install jquery@1.11.3 –S

It was added to to node_modules directory and package.json

I need to move those packages to wwwroot/lib

enter image description here

I'm using Gulp and I came up with a Script within gulpfile.js to move: /jquery/dist Directory with all of its files from node_modules to wwwroot/lib Directory

gulp.task('copyjquery', function () {
  gulp.src('./node_modules/jquery/**/*')
  .pipe(gulp.dest('./wwwroot/lib'));
});

However this script does not move the actual Folder jquery, it only moves the Folder dist with contents. I need the jquery Folder moved as well.

Can anyone see the issue with my script?

Paul
  • 974
  • 2
  • 13
  • 37

2 Answers2

1
gulp.task('copy', ['clean'], function () {
   return gulp.src(['./node_modules/jquery/**/*'], {
       base: 'node_modules'
   }).pipe(gulp.dest('./wwwroot/lib'));
});
Paul
  • 974
  • 2
  • 13
  • 37
0

If you used npm to install jQuery, it should've created a folder called node_modules (possibly hidden in Solution Explorer). You have to write some script (gulp, grunt, etc) to move the files you need out of that node_modules directory, and into your wwwroot/lib.

Steve Kennedy
  • 5,312
  • 3
  • 26
  • 41