Working on pipeline stuff

This commit is contained in:
2019-06-07 20:27:58 +10:00
parent 9f508a4aca
commit b643dd62d1
7 changed files with 118 additions and 55 deletions
+2 -2
View File
@@ -8,8 +8,8 @@
"restart": "forever -a -o forever.log -e error.log restart server/index.js",
"stop": "forever stop server/index.js",
"node": "node server/index.js",
"webpack": "webpack --mode=development",
"webpack-production": "webpack --mode=production",
"webpack": "webpack --mode=development --env=development",
"webpack-production": "webpack --mode=production --env=production",
"pull": "git pull && npm run webpack-production && npm restart"
},
"author": "Kayne Ruse",
+13
View File
@@ -45,3 +45,16 @@ Event Ideas
* Capture the flag.
Badge Ideas
---
* alpha tester
* capture the flag
* king of the hill
* gold horde
* combat master
* Beta tester
* Spy Master
* Referral Linker
* Bug Hunter (Reward List: Hegemon)
+9
View File
@@ -4,6 +4,15 @@
<meta charset = "UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/styles/shared.css"/>
<title>Kingdom Battles!</title>
<meta name="description" content="Build Your Kingdom!" />
<meta property="og:title" content="Kingdom Battles!" />
<meta property="og:description" content="Build Your Kingdom!" />
<meta property="og:image" content="https://kingdombattles.com/img/flag.png" />
<!--
<link rel="shortcut icon" href="https://kingdombattles.com/favicon.ico" type="image/x-icon" />
-->
</head>
<body>
<div id = "root"></div>
+5
View File
@@ -76,6 +76,11 @@ app.get('/*app.bundle.js', (req, res) => {
res.sendFile(path.resolve(`${__dirname}/../public/${req.originalUrl.split('/').pop()}`));
});
//source map (for development)
app.get('/app.bundle.js.map', (req, res) => {
res.sendFile(path.resolve(__dirname + `/../public/${req.originalUrl}`));
});
//fallback
app.get('*', (req, res) => {
res.sendFile(path.resolve(__dirname + '/../public/index.html'));
+2 -8
View File
@@ -1,7 +1,7 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware, compose } from 'redux';
import { createStore, applyMiddleware } from 'redux';
import thunk from 'redux-thunk';
import DevTools from './dev_tools.jsx';
@@ -17,10 +17,7 @@ account = account ? JSON.parse(account) : {};
var store = createStore(
reducer,
{ account: account }, //initial state
compose(
applyMiddleware(thunk),
DevTools.instrument()
)
applyMiddleware(thunk)
);
//persistence
@@ -31,10 +28,7 @@ store.subscribe(() => {
//start the process
ReactDOM.render(
<Provider store={store}>
<div>
<App />
<DevTools />
</div>
</Provider>,
document.querySelector("#root")
);
+40
View File
@@ -0,0 +1,40 @@
import React from 'react';
import ReactDOM from 'react-dom';
import { Provider } from 'react-redux';
import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import DevTools from './dev_tools.jsx';
import App from './components/app.jsx';
import reducer from './reducers/reducer.js';
//persistence
let ITEM_NAME = 'account.kingdombattles';
let account = localStorage.getItem(ITEM_NAME);
account = account ? JSON.parse(account) : {};
var store = createStore(
reducer,
{ account: account }, //initial state
compose(
applyMiddleware(thunk),
DevTools.instrument()
)
);
//persistence
store.subscribe(() => {
localStorage.setItem(ITEM_NAME, JSON.stringify(store.getState().account));
});
//start the process
ReactDOM.render(
<Provider store={store}>
<div>
<App />
<DevTools />
</div>
</Provider>,
document.querySelector("#root")
);
+6 -4
View File
@@ -1,11 +1,12 @@
const TerserPlugin = require('terser-webpack-plugin');
module.exports = {
entry: './src/index.jsx',
module.exports = env => {
return {
entry: `./src/index${env === 'production' ? '' : '_dev'}.jsx`,
output: {
path: __dirname + '/public/',
filename: 'app.bundle.js',
sourceMapFilename: 'app.js.map'
sourceMapFilename: 'app.bundle.js.map'
},
devtool: 'source-map',
module: {
@@ -24,7 +25,7 @@ module.exports = {
]
},
optimization: {
minimize: process.env.production,
minimize: env === 'production',
minimizer: [
new TerserPlugin({
terserOptions: {
@@ -35,4 +36,5 @@ module.exports = {
})
]
}
};
};