Stylesheet not loaded because of MIME-type

前端 未结 30 2934
猫巷女王i
猫巷女王i 2020-11-22 07:29

I\'m working on a website that uses gulp to compile and browser sync to keep the browser synchronised with my changes.

The gulp task compiles everything

30条回答
  •  执笔经年
    2020-11-22 07:56

    Bootstrap styles not loading #3411

    https://github.com/angular/angular-cli/issues/3411

    1. I installed Bootstrap v. 3.3.7

      npm install bootstrap --save
      
    2. Then I added the needed script files to apps[0].scripts in the angular-cli.json file:

      "scripts": [
          "../node_modules/bootstrap/dist/js/bootstrap.js"
      ],
      
      // And the Bootstrap CSS to the apps[0].styles array
      
      "styles": [
          "styles.css",
          "../node_modules/bootstrap/dist/css/bootstrap.css"
      ],
      
    3. I restarted ng serve

    It worked for me.

提交回复
热议问题