编译一个bootstrap源码文件

首先,请参照如何安装nodejs等

http://blog.csdn.net/rogerjava/article/details/18657219

然后按照bootstrap的文档

Compiling CSS and JavaScript

Bootstrap usesGruntwith convenient methods for working with the framework. It's how we compile our code, run tests, and more. To use it, install the required dependencies as directed and then run some Grunt commands.

Install Grunt

From the command line:

  1. Installgrunt-cliglobally withnpm install -g grunt-cli.
  2. Navigate to the root/bootstrapdirectory, then runnpm install. npm will look atpackage.jsonand automatically install the necessary local dependencies listed there.

When completed, you'll be able to run the various Grunt commands provided from the command line.

Unfamiliar withnpm? Don't have node installed?That's a-okay. npm stands fornode packaged modulesand is a way to manage development dependencies through node.js.Download and install node.jsbefore proceeding.

Available Grunt commands

Build -grunt

Rungruntto run tests locally and compile the CSS and JavaScript into/dist.UsesLessandUglifyJS.

Only compile CSS and JavaScript -grunt dist

grunt distcreates the/distdirectory with compiled files.UsesLessandUglifyJS.

Tests -grunt test

RunsJSHintandQUnittests headlessly inPhantomJS(used for CI).

Watch -grunt watch

This is a convenience method for watching just Less files and automatically building them whenever you save.


你可能感兴趣的:(bootstrap)