Source

Amûran ava bikin

Fêr bibin ka meriv çawa skrîptên npm yên Bootstrap-ê bikar tîne da ku belgeyên me ava bikin, koda çavkaniyê berhev bikin, ceribandinan bimeşînin, û hêj bêtir.

Sazkirina amûran

Bootstrap ji bo pergala avakirina xwe nivîsarên npm bikar tîne. Package.json me ji bo xebata bi çarçoweyê re rêbazên hêsan vedihewîne, tevî berhevkirina kodê, ceribandinên xebitandinê, û hêj bêtir.

Ji bo ku pergala avakirina me bikar bînin û belgeyên me li herêmî bimeşînin, hûn ê hewceyê kopiyek pelên çavkaniya Bootstrap û Node bin. Van gavan bişopînin û divê hûn amade bin ku rok bikin:

  1. Dakêşin û saz bikin Node.js , ku em bikar tînin ku girêdanên xwe birêve bibin.
  2. /bootstrapBigerin pelrêça root û birevin npm installda ku girêdanên me yên herêmî yên ku di pakêtê.json de hatine navnîş kirin saz bikin .
  3. Ruby saz bikin , bi Bundler re saz bikin gem install bundler, û di dawiyê de bimeşînin bundle install. Ev ê hemî girêdanên Ruby, wekî Jekyll û pêvekan saz bike.
    • Bikarhênerên Windows-ê: Vê rêbernameyê bixwînin da ku Jekyll bê pirsgirêk rabe û bixebite.

Dema ku qediya, hûn ê bikaribin fermanên cihêreng ên ku ji rêzika fermanê têne peyda kirin bimeşînin.

Bikaranîna nivîsarên npm

Our package.json includes the following commands and tasks:

Task Description
npm run dist npm run dist creates the /dist/ directory with compiled files. Uses Sass, Autoprefixer, and UglifyJS.
npm test Same as npm run dist plus it runs tests locally
npm run docs Builds and lints CSS and JavaScript for docs. You can then run the documentation locally via npm run docs-serve.

Run npm run to see all the npm scripts.

Autoprefixer

Bootstrap uses Autoprefixer (included in our build process) to automatically add vendor prefixes to some CSS properties at build time. Doing so saves us time and code by allowing us to write key parts of our CSS a single time while eliminating the need for vendor mixins like those found in v3.

We maintain the list of browsers supported through Autoprefixer in a separate file within our GitHub repository. See .browserslistrc for details.

Local documentation

Running our documentation locally requires the use of Jekyll, a decently flexible static site generator that provides us: basic includes, Markdown-based files, templates, and more. Here’s how to get it started:

  1. Run through the tooling setup above to install Jekyll (the site builder) and other Ruby dependencies with bundle install.
  2. From the root /bootstrap directory, run npm run docs-serve in the command line.
  3. Open http://localhost:9001 in your browser, and voilà.

Learn more about using Jekyll by reading its documentation.

Troubleshooting

Ger hûn di sazkirina pêwendiyan de bi pirsgirêkan re rû bi rû bimînin, hemî guhertoyên pêwendiyê yên berê (gerdûnî û herêmî) rakin. Piştre, dubare npm installbikin.