Skip to content

Instantly share code, notes, and snippets.

@DreySkee
DreySkee / webpack.config.js
Last active February 5, 2017 18:01
3 - Wordpress API + ReactJS
var webpack = require('webpack');
var path = require('path');
module.exports = {
devtool: 'inline-source-map', // This will show line numbers where errors are accured in the terminal
devServer: {
historyApiFallback: true, // This will make the server understand "/some-link" routs instead of "/#/some-link"
},
entry: [
'webpack-dev-server/client?http://127.0.0.1:8080/', // Specify the local server port
@DreySkee
DreySkee / index.html
Created January 30, 2017 23:57
2 - Wordpress API + ReactJS
<!DOCTYPE html>
<html>
<head>
<title>WP API</title>
</head>
<body>
<div id="app"></div> <!-- This div will be holding the app -->
<script src="bundle.js"></script> <!-- This is the main JS file that gets bundled by webpack -->
</body>
</html>
@DreySkee
DreySkee / package.json
Created January 30, 2017 23:55
1 - Wordpress API + ReactJS
{
"name": "wp-api",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"alt": "^0.18.6",
"axios": "^0.15.3",
"lodash": "^4.17.4",
"react": "^15.4.2",