Last active
May 11, 2016 12:26
-
-
Save iktakahiro/6c13d181a2962ed1d2b1 to your computer and use it in GitHub Desktop.
JavaScript のモダン開発環境を求めて 〜 前編・Riot.js 導入まで ref: http://qiita.com/iktakahiro/items/b0bcb37a61293b36af9e
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nodebrew のインストール | |
brew install nodebrew | |
# Node.js のインストール | |
mkdir -p ~/.nodebrew && cd ~/.nodebrew | |
nodebrew install-binary stable # stable は v4.2.1 などでも可 | |
# PATH を登録し、アクティブにする | |
echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.bashrc | |
source ~/.bashrc | |
nodebrew use stable # stable は v4.2.1 などでも可 | |
# npm を使った必要パッケージのグローバルインストール | |
npm install -g gulp babel bower |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir my-project && cd my-project | |
# 必要パッケージのローカルインストール | |
npm install gulp gulp-riot babel babel-core | |
# Riot.js の導入 | |
bower install riot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gulp riot |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import gulp from 'gulp'; | |
import riot from 'gulp-riot'; | |
gulp.task('riot', () => { | |
gulp.src('sample_list.tag') | |
.pipe(riot()) | |
.pipe(gulp.dest('dest')); | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
riot.tag('list', '<h2>{ opts.heading }</h2> <ul> <li each="{ item, i in items }">{ item }</li> </ul>', function(opts) { | |
const PI = 3.1415; | |
this.items = ['One', 'Two', PI]; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<list> | |
<h2>{ opts.heading }</h2> | |
<ul> | |
<li each={ item, i in items }>{ item }</li> | |
</ul> | |
<script> | |
const PI = 3.1415; | |
this.items = ['One', 'Two', PI]; | |
</script> | |
</list> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment