YeomanをUbuntuでセットアップする
- 2014.08.16
- javascript Prog
- yeoman
目次
Linux(Ubuntu14.04)でのYeomanセットアップ
npmからのyoインストール
macだと適当にnpmでゴニョゴニョするとyoコマンドがインストールできたわけですが、
はてubuntuだとどうやってインストールするのかと・・・
$ sudo apt-get install npm
$ sudo npm install -g yo grunt-cli bower
$ sudo npm install -g generator-webapp
$ bower install
$ npm install
$ mkdir yosample
$ cd yosample/
$ yo webapp
_-----_
| |
|--(o)--| .--------------------------.
`---------´ | Welcome to Yeoman, |
( _´U`_ ) | ladies and gentlemen! |
/___A___\ '__________________________'
| ~ |
__'.___.'__
´ ` |° ´ Y `
Out of the box I include HTML5 Boilerplate, jQuery, and a Gruntfile.js to build your app.
[?] What more would you like? (Press <space> to select)
‣⬢ Bootstrap
⬡ Sass
⬡ Modernizr
変なおっさんが出てきました。多分okだと思います。
コマンド後のディレクトリ構成
$ ls -al
合計 64
drwxrwxr-x 6 *** *** 4096 8月 15 21:00 .
drwxr-xr-x 54 *** *** 4096 8月 15 21:04 ..
-rw-r--r-- 1 *** *** 415 4月 9 17:59 .editorconfig
-rw-r--r-- 1 *** *** 11 4月 9 17:59 .gitattributes
-rw-r--r-- 1 *** *** 74 4月 9 17:59 .gitignore
-rw-r--r-- 1 *** *** 391 4月 9 17:59 .jshintrc
-rw-rw-r-- 1 *** *** 27 8月 15 21:00 .yo-rc.json
-rw-rw-r-- 1 *** *** 11309 8月 15 20:58 Gruntfile.js
drwxrwxr-x 5 *** *** 4096 8月 15 20:58 app
-rw-r--r-- 1 *** *** 145 4月 9 17:59 bower.json
drwxrwxr-x 4 *** *** 4096 8月 15 20:58 bower_components
drwxrwxr-x 24 *** *** 4096 8月 15 20:58 node_modules
-rw-rw-r-- 1 *** *** 889 8月 15 20:58 package.json
drwxrwxr-x 3 *** *** 4096 8月 15 21:00 test
Gruntにて保存した際の自動更新を有効に
$ grunt server
コマンドを実行したあとにapp/内のindex.htmlを編集すると、
自動的に更新がされると思います。
参考
- http://yeoman.io/learning/
- HOW TO INSTALL YEOMAN ON LINUX DEBIAN https://github.com/yeoman/yeoman/issues/461
-
前の記事
[PHP] foreachでの配列のキーがint値になる 2014.08.04
-
次の記事
ボゴソートをPHPで実装した 2014.08.24
コメントを投稿するにはログインしてください。