Bower replacement in Visual Studio 2017 ASP.NET MVC Core Template

前端 未结 6 2316
情深已故
情深已故 2021-02-12 10:59

Lately I created a ASP.NET MVC Core project from scratch using Visual Studio 2017 (15.6.3). I discovered the usual JavaScript frameworks:

  • bootstrap
  • jquery
6条回答
  •  误落风尘
    2021-02-12 11:21

    The solution is to do the following:

    1. Launch VS 2017 and open Tools - Extensions and Updates from the main menu
    2. In the window that opens, select Online on the left menu and type package in the Search box. Download the Package Installer
    3. Close all VS instances and wait a while, the VS installer will start which will install that package
    4. After installation, start VS and your project that should have a bower
    5. Start Project - Quick Install Package from the menu
    6. Select npm and type upgrade -g bower in the field
    7. The previous command will update the locations of the bower packages. Now create the bower.json file manually as follows:
      1. Right-click on the project and Add - New Item
      2. Select the JSON file and name it bower.json
      3. Open the file and type in the following file: {"name": "myproject"}
      4. Create another JSON file that you will only call .bowerrc
      5. Open the .bowerrc file and type the following:
      {
          "directory": "wwwroot / lib /",
          "registry": "https://registry.bower.io"
      }
      
    8. Right-click the bower.json file and select the Manage Bower Package option.
    9. In the Browse section, type mustache.js and install
    10. When you click on Project in the window you will see Manage Bower Package

    That is all!

提交回复
热议问题