Created
December 4, 2015 04:45
-
-
Save iktakahiro/d8856d7935dfa488e06b to your computer and use it in GitHub Desktop.
Babel 6 + ES6 + Mithril + MSX + gulp ref: http://qiita.com/iktakahiro/items/f39ed7629b593063792d
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
| npm install babel-plugin-mjsx --save-dev |
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.task('msx', () => { | |
| gulp.src('./src/js/before/sample.js') | |
| .pipe(babel()) | |
| .pipe(gulp.dest('./src/js/after/')) | |
| }); |
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
| { | |
| "babel": { | |
| "presets": [ | |
| "es2015" | |
| ], | |
| "plugins": [ | |
| "mjsx" | |
| ] | |
| } | |
| } |
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 _mithril = require('mithril'); | |
| var _mithril2 = _interopRequireDefault(_mithril); | |
| function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
| view = function () { | |
| return { | |
| tag: 'div', | |
| children: ['\n ', { | |
| tag: 'h1', | |
| children: ['MSXの利用'], | |
| attrs: { id: 'Title' } | |
| }, '\n ', { | |
| tag: 'div' | |
| }, '\n ', { | |
| tag: 'p', | |
| children: [{ | |
| tag: 'a', | |
| children: ['MSX'], | |
| attrs: { href: 'https://github.com/insin/msx' } | |
| }, 'の使いかたを解説します'] | |
| }, '\n '], | |
| attrs: { id: 'wrapper' } | |
| }; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment