Last active
September 13, 2017 18:05
-
-
Save johnlindquist/e03872343e6e2892162bd4ba38471645 to your computer and use it in GitHub Desktop.
Boilerplate: hyperapp + jsx + webpack 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
Show hidden characters
{ | |
"presets": ["es2015"], | |
"plugins": [ | |
[ | |
"transform-react-jsx", | |
{ | |
"pragma": "h" | |
} | |
] | |
] | |
} |
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-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" | |
} |
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
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