Visual Studio 2015 ASP.NET 5, Gulp task not to copy files from node_modules

I am trying to modify a script task that I borrowed from here ; after successfully completing a runner task in Visual Studio 2015 Task Runner Explorer , the files are not actually copied.

Here is the modified script:

/// <binding BeforeBuild='copy-assets' /> "use strict"; var _ = require('lodash'), gulp = require('gulp'); gulp.task('copy-assets', function() { var assets = { js: [ './node_modules/bootstrap/dist/js/bootstrap.js', './node_modules/systemjs/dist/system.src.js', './node_modules/angular2/bundles/angular2.dev.js', './node_modules/angular2/bundles/router.dev.js', './node_modules/angular2/bundles/angular2-polyfills.js', './node_modules/angular2/bundles/http.dev.js', './node_modules/rxjs/bundles/Rx.js', './node_modules/typescript/lib/typescript.js' ], css: ['./node_modules/bootstrap/dist/css/bootstrap.css'] }; _(assets).forEach(function(assets, type) { gulp.src(assets).pipe(gulp.dest('./webroot/' + type)); }); }); 

It seems that the task runner works without errors in Visual Studio 2015 Enterprise , but after that there are no files in my wwwroot / js or wwwroot / css

enter image description here

Here is the file structure:

enter image description here

What am I doing wrong and how to fix it? Any help is appreciated!

+11
angular npm asp.net-core asp.net-core-mvc gulp
Jan 6 '16 at 15:17
source share
1 answer

Minor oversight ... unfortunately gulp automatically creates the webroot directory and copies the files into it, it must be wwwroot . Oops !!

 /// <binding BeforeBuild='copy-assets' /> "use strict"; var _ = require('lodash'), gulp = require('gulp'); gulp.task('copy-assets', function() { var assets = { js: [ './node_modules/bootstrap/dist/js/bootstrap.js', './node_modules/systemjs/dist/system.src.js', './node_modules/angular2/bundles/angular2.dev.js', './node_modules/angular2/bundles/router.dev.js', './node_modules/angular2/bundles/angular2-polyfills.js', './node_modules/angular2/bundles/http.dev.js', './node_modules/rxjs/bundles/Rx.js', './node_modules/typescript/lib/typescript.js' ], css: ['./node_modules/bootstrap/dist/css/bootstrap.css'] }; _(assets).forEach(function(assets, type) { gulp.src(assets).pipe(gulp.dest('./wwwroot/' + type)); }); }); 

: hit:

+14
Jan 6 '16 at 16:46 on
source share



All Articles