How do I load bootstrap using npm?

后端 未结 7 414
无人共我
无人共我 2021-02-01 15:35

I have a npm project that uses jquery.

var $ = require(\'jquery\');

I also have an index html file that references bootstrap.

  • 7条回答
    •  执笔经年
      2021-02-01 15:57

      Bootstrap is now a supported node package by the bootstrap guys.

      https://www.npmjs.org/package/bootstrap

      What this means is you can now require bootstrap in code. So.

      npm install bootstrap --save

      npm install jquery --save

      foo.js

      var $ = require('jquery');
      window.$ = $;
      require('bootstrap');
      

    提交回复
    热议问题