-
-
Save skulbrane/b8a2e87ab052375799160bb72d0b7865 to your computer and use it in GitHub Desktop.
Example Gulp build for Riotjs + ES6 + Browserify + Babelify + Riotify
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 './app.tag' | |
| riot.mount('#app', 'app') |
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
| require('./dashboard.tag') | |
| <app> | |
| <section id="main"> | |
| <h1>Total EcoSystem Pageviews</h1> | |
| <dashboard></dashboard> | |
| </section> | |
| </app> |
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
| require('./dashboard-graph.tag') | |
| <dashboard> | |
| <dashboard-graph ecosystem={ecosystem}></dashboard-graph> | |
| <script type="es6"> | |
| import moment from 'moment' | |
| this.ecosystem = 1 | |
| this.on('mount', () => { | |
| Z.dispatcher.on('set:ecosystem', (ecosystem) => { | |
| this.update({ecosystem}) | |
| }) | |
| }) | |
| </script> | |
| </dashboard> |
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
| var gulp = require('gulp') | |
| var browserify = require('browserify') | |
| var watchify = require('watchify') | |
| var riotify = require('riotify') | |
| var babelify = require('babelify') | |
| var source = require('vinyl-source-stream') | |
| gulp.task('bundle:app', function () { | |
| var b = browserify(watchify.args) | |
| b.external(VENDORS) | |
| b.add(APP_ENTRY) | |
| b.transform(babelify) | |
| b.transform(riotify) | |
| b.bundle() | |
| .pipe(source('bundle.js')) | |
| .pipe(buffer()) | |
| .pipe(gulp.dest(BUILD)) | |
| return b | |
| }) |
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> | |
| <html> | |
| <head> | |
| <meta charset="utf-8"> | |
| <title>EcoSystem Dashboard</title> | |
| <link rel="stylesheet" href="main.css" media="screen" /> | |
| </head> | |
| <body> | |
| <div id="app"></div> | |
| <script type="text/javascript" src="bundle.js"></script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment