Using Bower to add the Bootstrap 4 files

In order to use Bootstrap 4 in your project, you first need to add the Bootstrap style sheet and JavaScript files. In this example, you'll use Bower to download the Bootstrap 4 files to your local project:

  1. Add a new file called bower.json to the root of your project folder and set its content to the following in order to add Bootstrap 4 as a dependency:
            { 
              "name": "ASP.NET", 
              "private": true, 
              "dependencies": { 
                "bootstrap": "4.0" 
              } 
            } 
    
  2. In order to download any Bower dependencies, you'll need to open a new command prompt in your project folder—this can be done from within Visual Studio Code using the keyboard shortcut Shift + Ctrl + C.
  3. Enter the following command inside the command prompt and press Enter:
            bower update 
    
    
  4. The previous command will download any Bower dependencies specified inside the bower.json file and save it to a bower_components folder inside your project.
  5. After the Bower dependencies has been downloaded, your project layout should resemble the following inside the Visual Studio Code explorer:
    Using Bower to add the Bootstrap 4 files

    Tip

    If you receive the following error, ENOGIT git is not installed or not in the PATH, it means that you do not have the Git installation folder path specified in your environment variables. Fix this by adding the following values to your Windows environment variables: ;%PROGRAMFILES(x86)%Gitin;%PROGRAMFILES(x86)%Gitcmd Another workaround is to run the command from the Git Shell instead of the normal command prompt.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.202.27