Skip to content

Instantly share code, notes, and snippets.

@johnlindquist
Last active September 13, 2017 18:05
Show Gist options
  • Save johnlindquist/e03872343e6e2892162bd4ba38471645 to your computer and use it in GitHub Desktop.
Save johnlindquist/e03872343e6e2892162bd4ba38471645 to your computer and use it in GitHub Desktop.
Boilerplate: hyperapp + jsx + webpack minimal
{
"presets": ["es2015"],
"plugins": [
[
"transform-react-jsx",
{
"pragma": "h"
}
]
]
}
<!doctype html>
<html>
<body>
<script src="bundle.js"></script>
</body>
</html>
import { h, app } from "hyperapp"
app({
state: {
message: "Hi."
},
view: state => <h1>{state.message}</h1>
})
{
"name": "hyperapp-jsx-webpack-minimal-boilerplate",
"version": "0.0.0",
"description": "hyperapp + jsx + webpack minimal boilerplate",
"main": "index.js",
"dependencies": {
"hyperapp": "*"
},
"devDependencies": {
"babel-core": "^6.25.1",
"babel-loader": "^7.1.1",
"babel-plugin-transform-react-jsx": "^6.24.1",
"babel-preset-es2015": "^6.24.1",
"webpack": "^3.3.0",
"webpack-dev-server": "*"
},
"scripts": {
"test": "exit 1",
"build": "webpack -p",
"start": "webpack-dev-server"
},
"keywords": [
"hyperapp"
],
"author": "Jorge Bucaran",
"license": "MIT",
"bin": "node_modules/.bin/webpack-dev-server"
}
module.exports = {
entry: "./index.js",
output: {
filename: "bundle.js",
},
module: {
loaders: [{
test: /\.js$/,
exclude: /node_modules/,
loader: "babel-loader"
}]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment