How to use Bootstrap 4 in ASP.NET Core

前端 未结 10 962
故里飘歌
故里飘歌 2020-12-04 05:11

I want to update Bootstrap in ASP.NET Core with NuGet. I used this:

Install-Package bootstrap -Version 4.0.0

It did add the dependencies bu

10条回答
  •  既然无缘
    2020-12-04 05:42

    Libman seems to be the tool preferred by Microsoft now. It is integrated in Visual Studio 2017(15.8).

    This article describes how to use it and even how to set up a restore performed by the build process.

    Bootstrap's documentation tells you what files you need in your project.

    The following example should work as a configuration for libman.json.

    {
      "version": "1.0",
      "defaultProvider": "cdnjs",
      "libraries": [
      {
        "library": "twitter-bootstrap@4.2.1",
        "destination": "wwwroot/lib/bootstrap",
        "files": [
        "js/bootstrap.bundle.js",
        "css/bootstrap.min.css"
        ]
      },
      {
        "library": "jquery@3.3.1",
        "destination": "wwwroot/lib/jquery",
        "files": [
          "jquery.min.js"
        ]
      }
    ]
    }
    

提交回复
热议问题