Created
August 26, 2017 02:24
-
-
Save ramanan12345/b94fd8b2e37343675fe3fe4bac1e31f9 to your computer and use it in GitHub Desktop.
Boilerplate: hyperapp + jsx + rollup minimal
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> | |
| <body> | |
| <script src="bundle.js"></script> | |
| </body> | |
| </html> |
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 { h, app } from "hyperapp" | |
| app({ | |
| state: { | |
| message: "Hi." | |
| }, | |
| view: state => <h1>{state.message}</h1> | |
| }) |
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
| { | |
| "name": "hyperapp-jsx-rollup-minimal-boilerplate", | |
| "version": "0.0.0", | |
| "description": "hyperapp + jsx + rollup minimal boilerplate", | |
| "main": "index.js", | |
| "dependencies": { | |
| "hyperapp": "*" | |
| }, | |
| "devDependencies": { | |
| "babel-plugin-transform-react-jsx": "^6.23.0", | |
| "babel-preset-es2015-rollup": "^3.0.0", | |
| "rollup": "^0.41.4", | |
| "rollup-plugin-babel": "^2.7.1", | |
| "rollup-plugin-node-resolve": "^2.0.0", | |
| "rollup-plugin-uglify": "^1.0.1" | |
| }, | |
| "scripts": { | |
| "test": "exit 1", | |
| "build": "rollup -cf iife -i index.js -o bundle.js" | |
| }, | |
| "keywords": [ | |
| "hyperapp" | |
| ], | |
| "author": "Jorge Bucaran", | |
| "license": "MIT" | |
| } |
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 babel from "rollup-plugin-babel" | |
| import resolve from "rollup-plugin-node-resolve" | |
| import uglify from "rollup-plugin-uglify" | |
| export default { | |
| plugins: [ | |
| babel({ | |
| babelrc: false, | |
| presets: ["es2015-rollup"], | |
| plugins: [ | |
| ["transform-react-jsx", { pragma: "h" }] | |
| ] | |
| }), | |
| resolve({ | |
| jsnext: true | |
| }), | |
| uglify() | |
| ] | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment