首先,请参照如何安装nodejs等
http://blog.youkuaiyun.com/rogerjava/article/details/18657219
然后按照bootstrap的文档
Compiling CSS and JavaScript
Bootstrap uses Grunt with 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:
- Install
grunt-cliglobally withnpm install -g grunt-cli. - Navigate to the root
/bootstrapdirectory, then runnpm install. npm will look at package.json and 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 with npm? Don't have node installed? That's a-okay. npm stands for node packaged modulesand is a way to manage development dependencies through node.js. Download and install node.js before proceeding.
Available Grunt commands
Build - grunt
Run grunt to run tests locally and compile the CSS and JavaScript into /dist. Uses Less and UglifyJS.
Only compile CSS and JavaScript - grunt dist
grunt dist creates the /dist directory with compiled files. Uses Less and UglifyJS.
Tests - grunt test
Runs JSHint and QUnit tests headlessly in PhantomJS (used for CI).
Watch - grunt watch
This is a convenience method for watching just Less files and automatically building them whenever you save.
本文介绍如何使用Grunt工具来构建Bootstrap项目,包括安装必要的依赖、编译CSS和JavaScript文件,以及运行本地测试等内容。
725

被折叠的 条评论
为什么被折叠?



