Installation
Crab is compiling from ES2015+ to ES5 ready because it comes with native-shim (and also custom-elements) polyfill included.
Install crab with package manager
# yarn
yarn add @kocisov/crab
# npm
npm install --save @kocisov/crab
If you are using Uglify for minification, Crab requires harmony version of Uglify instead of default to work properly.
You can add it to your project with this command.
# yarn
yarn add --dev git://github.com/mishoo/UglifyJS2#harmony
# npm
npm install --save-dev git://github.com/mishoo/UglifyJS2#harmony
Or you can use babili and its babili-webpack-plugin
Include crab into your code
UMD bundle available at @kocisov/crab/browser
// if you are compiling with babel
import { Component, defineComponents, render } from '@kocisov/crab'
// if you are not
const { Component, defineComponents, render } = Crab // window.Crab
// ...
render(`
<h2>Hello</h2>
`, document.getElementById('root'))