1年くらい前とすっかり様変わりしてました。分離してbuild scriptが標準で入っていません。build scriptもantとnodeが利用できるようになりました。
元々、jpgを軽くするにしか使っていませんでしたが。 今回は、nodeを使います。

インストール

npmを使ってインストールします。

npm install -g h5bp

# PATHの設定
# npmは、brewでインストールしている。
export PATH=$PATH:/usr/local/share/npm/bin

# たぶん、grunt-cliも必要だったかも

初期設定

h5bp init

# 次の4stepに答えます。
- project:    Basic project configuration (name, description, version, ...)
- layout:     [D]efault, [C]ustom, [S]illy
- files:      Depends on layout value, series of prompts for specific
              file / directory renames
- gruntfile:  Gruntfile creation

# 基本的にすべてdefault

lease answer the following:
[?] Project name (foo)
[?] Description (The best project ever.)
[?] Version (0.1.0)
[?] Project git repository (git://github.com/toenobu/h5bp.git)
[?] Project homepage (none)
[?] Licenses (MIT)
[?] Author name (toenobu)
[?] Author email (me@toenobu.name)
[?] Author url (none)
[?] Do you need to force an update on master repo? (y)
[?] Do you need to make any changes to the above before continuing? (y/N) N

Please answer the following:
help:   » [D]efault:  Standard html5-boilerplate layout
help:
help:   » [C]ustom:   Specific build of html5-boilerplate. A series of prompt allows
help:                 explicit file rewrites for common files and directories.
help:
help:   » [S]illy:    A "silly" build will prompt for every file in the h5bp repository.
help:
[?] Which layout ? ([D]efault, [C]ustom, [S]illy) D
[?] Do you need to make any changes to the above before continuing? (y/N) N

Please answer the following:
[?] Is the DOM involved in ANY way? (Y/n) Y
[?] Will files be concatenated or minified? (Select no if using require.js to organize and minify your javascript) (Y/n) Y
[?] Will you have a package.json file? (Y/n) Y
[?] What is the intermediate/ directory for the build script? (intermediate/)
[?] What it is the final build output directory? (publish/)
[?] What is the CSS directory? (css/)
[?] What is the JS directory? (js/)
[?] What is the IMG directory? (img/)
[?] Will this project use require.js to organize it's javascript? (Y/n)
[?] Do you need to make any changes to the above before continuing? (y/N) N

Writing .gitattributes...OK
Writing .gitignore...OK
...
Writing LICENSE-MIT...OK
Writing grunt.js...OK

Initialized from template "h5bp".

ビルド

h5bp build:default

# publish ディレクトリ生成され、処理されたファイルがある。
Read and Post Comments