簡體   English   中英

通過npm安裝Bootstrap怎么辦?

[英]What do I do with Bootstrap installed through npm?

假設我跑了

$ npm install bootstrap --save

現在,在node_modules文件夾中,有一個包含Bootstrap發行版的bootstrap文件夾。 我應該怎么辦?

這是我項目的(簡化)結構,一個用於撰寫博客文章的模板( https://github.com/jacquerie/portfolio-template ):

.
├── Gruntfile.js
├── css
│   └── application.css
├── index.html
├── js
│   └── application.js
├── package.json
└── node_modules
    └── bootstrap

可以做類似的事情

$ cp node_modules/bootstrap/dist/css/bootstrap.css css

但這看起來很簡單,這是我不想記住的手動步驟。 我可以使用grunt-contrib-copy來修復后者在Gruntfile.js創建一些任務的Gruntfile.js ,但這看起來像一個hack。

有沒有更好的辦法?

由於其依賴於扁平樹,因此應改為使用bower,npm是針對服務器端的。 此外,您不必更改位置模塊,直接將bower_components / bootstrap / dist / css / bootstrap.css鏈接到項目。

bower install --save bootstrap

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM