Skip to content

Instantly share code, notes, and snippets.

@iktakahiro
Created December 4, 2015 04:45
Show Gist options
  • Save iktakahiro/d8856d7935dfa488e06b to your computer and use it in GitHub Desktop.
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
npm install babel-plugin-mjsx --save-dev
gulp.task('msx', () => {
gulp.src('./src/js/before/sample.js')
.pipe(babel())
.pipe(gulp.dest('./src/js/after/'))
});
{
"babel": {
"presets": [
"es2015"
],
"plugins": [
"mjsx"
]
}
}
'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