Source

Bil tul dɛn

Lan aw fɔ yuz Bootstrap in inklud npm skript fɔ bil wi dɔkyumentri, kɔmpilayt sɔs kɔd, rɔn tɛst, ɛn ɔda tin dɛn.

Sɛtup fɔ tul dɛn

Bootstrap de yuz NPM skript fɔ in bil sistem. Wi package.json gɛt fayn fayn we dɛn fɔ wok wit di fremwɔk, lɛk fɔ kɔmpilayt kɔd, fɔ rɔn tɛst, ɛn ɔda tin dɛn.

Fɔ yuz wi bild sistem ɛn rɔn wi dɔkyumentri lokal wan, yu go nid wan kɔpi fɔ Bootstrap in sɔs fayl dɛn ɛn Node. Fɔ fala dɛn step ya ɛn yu fɔ rɛdi fɔ rɔk:

  1. Daunlod ɛn instɔl Node.js , we wi kin yuz fɔ manej wi dipɛnsin dɛn.
  2. Navigate to di rut /bootstrapdairektrɔ ɛn rɔn npm installfɔ instɔl wi lokal dipɛnsin dɛn we de na package.json .
  3. Instɔl Ruby , instɔl Bundler wit gem install bundler, ɛn las las rɔn bundle install. Dis go instɔl ɔl di Ruby dipɛnsin dɛn, lɛk Jekyll ɛn plɔgin dɛn.
    • Di wan dɛn we de yuz Windows: Rid dis gayd fɔ mek Jekyll bigin fɔ wok ɛn nɔ gɛt prɔblɛm.

We yu dɔn, yu go ebul fɔ rɔn di difrɛn kɔmand dɛn we dɛn gi yu frɔm di kɔmand layn.

Yuz di NPM skript dɛn

Wi package.json gɛt dɛn kɔmand ɛn wok dɛn ya:

Wok Tɔk bɔt
npm run dist npm run distde mek di /distdairektrɔ wit fayl dɛn we dɛn dɔn kɔmpilayt. Yuz Sass , Ɔtoprɛfiksa , ɛn UglifyJS .
npm test Same as npm run distplus i de ron test lokal
npm run docs Bil ɛn lint CSS ɛn JavaSkript fɔ dɔkyumɛnt dɛn. Dɔn yu kin rɔn di dɔkyumentri lokal wan bay npm run docs-serve.

Rɔn npm runfɔ si ɔl di npm skript dɛn.

Ɔtoprɛfiksa

Bootstrap de yuz Autoprefixer (we de insay wi bil prɔses) fɔ ad vendor prɛfiks dɛn ɔtomɛtik wan to sɔm CSS prɔpati dɛn we dɛn de bil. We wi du dat, i de sev wi tɛm ɛn kɔd bay we i de alaw wi fɔ rayt di men pat dɛn na wi CSS wan tɛm we wi nɔ nid fɔ gɛt vendor mixins lɛk di wan dɛn we de na v3.

Wi de kip di list fɔ di brawza dɛn we dɛn sɔpɔt tru Autoprefixer insay wan sɛpret fayl insay wi GitHub ripɔsitɔri. Si /.browserslistrc fɔ di ditel dɛn.

Di lokal dɔkyumɛnt dɛn

Fɔ rɔn wi dɔkyumentri lokal wan nid fɔ yuz Jekyll, wan decently fleksibul statik sayt jenɛratɔ we de gi wi: besik inklud, Markdown-based fayl dɛn, tɛmplat, ɛn mɔ. Na dis na aw fɔ mek i bigin:

  1. Rɔn tru di tul sɛtup we de ɔp fɔ instɔl Jekyll (di sayt bilda) ɛn ɔda Ruby dipɛnsin dɛn wit bundle install.
  2. Frɔm di rut /bootstrapdairektrɔ, rɔn npm run docs-servena di kɔmand layn.
  3. Opin http://localhost:9001na yu brawza, ɛn voilà.

Lan mɔ bɔt aw fɔ yuz Jekyll bay we yu rid in dɔkyumentri .

Fɔ sɔlv prɔblɛm dɛn

If yu gɛt prɔblɛm wit fɔ instɔl dipɛnsin dɛn, ɔninstɔlɔ ɔl di dipɛnsin vɛshɔn dɛn we bin dɔn de bifo (global ɛn lokal). Dɔn, rirun npm install.