5.1.1 • Published 7 years ago
mopt v5.1.1
mopt
A babel plugin to statically optimize mithril hyperscript function invocations.
// This hyperscript function invocation
m(".fooga");
// Gets optimized into
m.vnode("div",undefined,{className:"fooga"},undefined,undefined,undefined);
Please file an issue if you come across any cases that this doesn't handle, I'd love to improve the number of structures I can rewrite!
Mithril Version Warning
mopt
only works with mithril@1.x
.
For optimizing mithril@0.2.x
see mithril-objectify.
Installation
Install with npm
npm i mopt
Usage with Babel
.babelrc
// .babelrc
{
"plugins": [ "mopt" ]
}
CLI
$ babel --plugins mopt script.js
API
require("babel-core").transform("<code>", {
plugins: [ "mopt" ]
});
Usage with a bundler
Rollup - rollup-plugin-babel
Browserify - babelify
WebPack - babel-loader
5.1.1
7 years ago
5.0.2
7 years ago
5.0.1
7 years ago
5.0.0
7 years ago
4.3.1
7 years ago
4.3.0
7 years ago
4.2.0
7 years ago
4.1.4
7 years ago
4.1.3
7 years ago
4.1.2
7 years ago
4.1.1
7 years ago
4.1.0
7 years ago
4.0.7
7 years ago
4.0.6
7 years ago
4.0.5
7 years ago
4.0.4
8 years ago
4.0.3
8 years ago
4.0.2
8 years ago
4.0.1
8 years ago
4.0.0
8 years ago