What's the correct way to use Bower in ASP.Net 5 and VS2015?

I am currently trying to log into ASP.Net 5 and I am struggling to find a "way to go" to use Bower in this.

My project structure looks something like this:

testProject
  - wwwroot
      - index.html
  - bower_components (hidden by default in project.json)
      - angular
          - ...
      - ...
  - node_components  (hidden by default in project.json)
      - grunt
          - ...
      - ...
  - bower.json
  - Gruntfile.js
  - package.json
  - project.json
  - Startup.cs

      

I cannot access bower_components

in index.html

and since it is not included in the project by default, I assume it meant this path.

So what is the expected way to work with bower libraries?

I've seen a lot of people use grunt-bower-task

to install libraries again in wwwroot/lib

(or some other folder in wwwroot), but this seems overkill to me since Visual Studio already installs packages to the project directory.

An alternative could be to use grunt-copy

to move files from bower_components

to the target folder, but this way you will need to list each library you want to include again.

So someone already got some experience with this processing and would share how you do it?

+3


source to share


1 answer


Hmmm .. Not sure if I understood the problem correctly, but anyway, if the problem is only in the bower destination folder, just add the .bowerrc

file to your root with content like:

{
    "directory" : "wwwroot/lib"
}

      



and after the command bower install

, bower will download libs in your dest folder

+5


source







All Articles