Travis Boatman
Travis Boatman

Reputation: 2282

How can I move bower libraries in ASP.NET Core?

In my wwwroot folder I have two subfolders called lib and lib_bower. My lib_bower folder is setup in my .bowerrc file like so:

{
  "directory": "wwwroot/lib_bower"
}

When I restore bower packages I'm left with this:

enter image description here

I'd like to move the entire dist folder from bootstrap into my lib folder when I build if the files are not found. How can I do this?

Upvotes: 2

Views: 707

Answers (1)

adem caglin
adem caglin

Reputation: 24073

You can use gulp task runner to move bootstrap folder into lib folder.

Configuration code(gulpfile.js):

var gulp = require('gulp');

gulp.task('default', function () {
    // place code for your default task here
});

var paths = {};
paths.webroot = "wwwroot/";
paths.bowerSrc = "./wwwroot/lib_bower/";
paths.lib = paths.webroot + "lib/";

gulp.task("copy-bootstrap", function () {
    return gulp.src(paths.bowerSrc + '/bootstrap/dist/**/*.*', { base: paths.bowerSrc + '/bootstrap/dist/' })
         .pipe(gulp.dest(paths.lib + '/bootstrap/'));
}); 

Then right click gulpfile.js, select Task Runner Explorer, run the copy-bootstrap task or set Bindings to Before Build .

Upvotes: 5

Related Questions