Created
September 28, 2014 07:28
-
-
Save ishiduca/aba6c2440541c49d3cbe to your computer and use it in GitHub Desktop.
ractivate で ractive.js を brwoserify に対応させる
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
<!doctype html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Ractiv.ate</title> | |
<head> | |
<body> | |
<div id="main"></div> | |
<script src="./bundle.js"></script> | |
</body> |
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
'use strict' | |
var Ractive = require('ractive') | |
var ractive = new Ractive({ | |
el: '#main' | |
, template: require('./template.html') | |
, data: { | |
foo: 'bar' | |
} | |
}) |
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
{ | |
"version": "0.0.1", | |
"name": "ractivate-demo", | |
"dependencies": { | |
"ractivate": "^0.2.0", | |
"ractive": "^0.5.8" | |
}, | |
"scripts": { | |
"build": "browserify -t ractivate ./main.js > ./bundle.js" | |
} | |
} |
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
<div>{{foo}}</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
npm run build
するとbundle.js
をビルドする。(実際は
browserify -t ractivate ./main.js > ./build.js
してるだけ)$
tree -F -L 2 .
してディレクトリ内を見ると詳しくは https://github.com/jrajav/ractivate