所以我尝试从git://github.com/ twitter /bootstrap.git源代码“构建”twitter bootstrap,然后用git将其克隆到我的本地机器上。
显然,在我的本地机器上,我已经安装了nodejs和npm,并且还安装了所需的node包less和uglify-js。所有的节点模块都在我的系统路径中,所以"lessc“和"uglifyjs”命令在我的终端中是可用的。
进入bootstrap的根目录,我运行"make“命令,输出如下:
(luc)calvins-MacBook.local ttys002 Fri Feb 03 10:51:29 |~/work/luc/static/bootstrap|
calvin$ make
mkdir -p bootstrap/img
mkdir -p bootstrap/css
mkdir -p bootstrap/js
cp img/* bootstrap/img/
lessc ./less/bootstrap.less > bootstrap/css/bootstrap.css
lessc --compress ./less/bootstrap.less > bootstrap/css/bootstrap.min.css
lessc ./less/responsive.less > bootstrap/css/bootstrap.responsive
lessc --compress ./less/responsive.less > bootstrap/css/bootstrap.min.responsive
cat js/bootstrap-transition.js js/bootstrap-alert.js js/bootstrap-button.js js/bootstrap-carousel.js js/bootstrap-collapse.js js/bootstrap-dropdown.js js/bootstrap-modal.js js/bootstrap-tooltip.js js/bootstrap-popover.js js/bootstrap-scrollspy.js js/bootstrap-tab.js js/bootstrap-typeahead.js > bootstrap/js/bootstrap.js
uglifyjs -nc bootstrap/js/bootstrap.js > bootstrap/js/bootstrap.min.js
zip -r docs/assets/bootstrap.zip bootstrap
updating: bootstrap/ (stored 0%)
updating: bootstrap/css/ (stored 0%)
updating: bootstrap/css/bootstrap.css (deflated 85%)
updating: bootstrap/css/bootstrap.min.css (deflated 84%)
updating: bootstrap/css/bootstrap.min.responsive (deflated 76%)
updating: bootstrap/css/bootstrap.responsive (deflated 79%)
updating: bootstrap/img/ (stored 0%)
updating: bootstrap/img/glyphicons-halflings-white.png (deflated 4%)
updating: bootstrap/img/glyphicons-halflings.png (deflated 4%)
updating: bootstrap/js/ (stored 0%)
updating: bootstrap/js/bootstrap.js (deflated 82%)
updating: bootstrap/js/bootstrap.min.js (deflated 74%)
rm -r bootstrap
lessc ./less/bootstrap.less > ./docs/assets/css/bootstrap.css
lessc ./less/responsive.less > ./docs/assets/css/bootstrap-responsive.css
node docs/build
cp img/* docs/assets/img/
cp js/*.js docs/assets/js/
cp js/tests/vendor/jquery.js docs/assets/js/
cp js/tests/vendor/jquery.js docs/assets/js/接下来我应该怎么做才能在我的html页面中包含我的css文件?我看不到构建/创建的bootstrap.min.css或bootstrap.min.responsive文件位于何处。唯一改变的似乎是创建了一个"bootstrap.zip“,正如上面运行git status所看到的那样。
(luc)calvins-MacBook.local ttys002 Fri Feb 03 10:51:35 |~/work/luc/static/bootstrap|
calvin$ git status
# Not currently on any branch.
# Changes not staged for commit:
# (use "git add <file>..." to update what will be committed)
# (use "git checkout -- <file>..." to discard changes in working directory)
#
# modified: docs/assets/bootstrap.zip
#
no changes added to commit (use "git add" and/or "git commit -a")发布于 2012-11-11 15:44:50
如果任何人正在寻找make的替代品来构建Bootstrap (特别是因为make不是Windows友好的),那么有一个build system for Bootstrap with Grunt.js
在大多数情况下,它会产生与makefile相同的结果。grunt -contrib qunit任务将在Grun0.4.0发布时为qunit/phantomjs添加更好的支持(此处:https://github.com/gruntjs/grunt-contrib-qunit)。在此之前,您仍然可以使用内置的Grunt任务进行测试。
https://stackoverflow.com/questions/9123112
复制相似问题