mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 01:31:17 +00:00
Add /dev.html page w/ full redux dev tools
* normal page wont have store instrumented to stay lean * reshuffled vendor deps to balance bundle sizes
This commit is contained in:
@@ -7,7 +7,7 @@ import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { Provider } from 'react-redux';
|
||||
|
||||
import configureStore from './stores/configureStore';
|
||||
import configureStore from './stores/configureStore.dev';
|
||||
import App from './components/app';
|
||||
|
||||
import DevTools from './components/dev-tools';
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./main.prod');
|
||||
} else {
|
||||
module.exports = require('./main.dev');
|
||||
}
|
||||
require('font-awesome-webpack');
|
||||
require('../styles/main.less');
|
||||
require('../images/favicon.ico');
|
||||
|
||||
import 'babel-polyfill';
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { Provider } from 'react-redux';
|
||||
|
||||
import configureStore from './stores/configureStore';
|
||||
import App from './components/app';
|
||||
|
||||
const store = configureStore();
|
||||
|
||||
ReactDOM.render(
|
||||
<Provider store={store}>
|
||||
<div>
|
||||
<App />
|
||||
</div>
|
||||
</Provider>,
|
||||
document.getElementById('app')
|
||||
);
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
require('font-awesome-webpack');
|
||||
require('../styles/main.less');
|
||||
require('../images/favicon.ico');
|
||||
|
||||
import 'babel-polyfill';
|
||||
import React from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { Provider } from 'react-redux';
|
||||
|
||||
import configureStore from './stores/configureStore';
|
||||
import App from './components/app';
|
||||
|
||||
const store = configureStore();
|
||||
|
||||
ReactDOM.render(
|
||||
<Provider store={store}>
|
||||
<div>
|
||||
<App />
|
||||
</div>
|
||||
</Provider>,
|
||||
document.getElementById('app')
|
||||
);
|
||||
@@ -1,5 +1,12 @@
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
module.exports = require('./configureStore.prod');
|
||||
} else {
|
||||
module.exports = require('./configureStore.dev');
|
||||
import { createStore, applyMiddleware } from 'redux';
|
||||
import thunkMiddleware from 'redux-thunk';
|
||||
|
||||
import { initialState, rootReducer } from '../reducers/root';
|
||||
|
||||
export default function configureStore() {
|
||||
return createStore(
|
||||
rootReducer,
|
||||
initialState,
|
||||
applyMiddleware(thunkMiddleware)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
import { createStore, applyMiddleware } from 'redux';
|
||||
import thunkMiddleware from 'redux-thunk';
|
||||
|
||||
import { initialState, rootReducer } from '../reducers/root';
|
||||
|
||||
export default function configureStore() {
|
||||
return createStore(
|
||||
rootReducer,
|
||||
initialState,
|
||||
applyMiddleware(thunkMiddleware)
|
||||
);
|
||||
}
|
||||
@@ -29,6 +29,11 @@ module.exports = {
|
||||
'webpack-dev-server/client?http://' + WEBPACK_SERVER_HOST + ':4041',
|
||||
'webpack/hot/only-dev-server'
|
||||
],
|
||||
'dev-app': [
|
||||
'./app/scripts/main.dev',
|
||||
'webpack-dev-server/client?http://' + WEBPACK_SERVER_HOST + ':4041',
|
||||
'webpack/hot/only-dev-server'
|
||||
],
|
||||
'contrast-app': [
|
||||
'./app/scripts/contrast-main',
|
||||
'webpack-dev-server/client?http://' + WEBPACK_SERVER_HOST + ':4041',
|
||||
@@ -39,9 +44,10 @@ module.exports = {
|
||||
'webpack-dev-server/client?http://' + WEBPACK_SERVER_HOST + ':4041',
|
||||
'webpack/hot/only-dev-server'
|
||||
],
|
||||
vendors: ['babel-polyfill', 'classnames', 'd3', 'dagre', 'immutable',
|
||||
'lodash', 'page', 'react', 'react-dom', 'react-redux', 'react-motion',
|
||||
'redux', 'redux-thunk']
|
||||
vendors: ['babel-polyfill', 'classnames', 'd3', 'dagre', 'filesize',
|
||||
'immutable', 'lodash', 'moment', 'page', 'react',
|
||||
'react-dom', 'react-motion', 'react-redux', 'redux', 'redux-thunk',
|
||||
'reqwest']
|
||||
},
|
||||
|
||||
// This will not actually create a app.js file in ./build. It is used
|
||||
@@ -66,6 +72,11 @@ module.exports = {
|
||||
template: 'app/html/index.html',
|
||||
filename: 'terminal.html'
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
chunks: ['vendors', 'dev-app'],
|
||||
template: 'app/html/index.html',
|
||||
filename: 'dev.html'
|
||||
}),
|
||||
new HtmlWebpackPlugin({
|
||||
chunks: ['vendors', 'app'],
|
||||
template: 'app/html/index.html',
|
||||
|
||||
@@ -24,8 +24,9 @@ module.exports = {
|
||||
app: './app/scripts/main',
|
||||
'contrast-app': './app/scripts/contrast-main',
|
||||
'terminal-app': './app/scripts/terminal-main',
|
||||
vendors: ['babel-polyfill', 'classnames', 'd3', 'dagre', 'immutable',
|
||||
'lodash', 'page', 'react', 'react-dom', 'react-redux', 'react-motion',
|
||||
// keep only some in here, to make vendors and app bundles roughly same size
|
||||
vendors: ['babel-polyfill', 'classnames', 'd3', 'immutable',
|
||||
'lodash', 'react', 'react-dom', 'react-redux',
|
||||
'redux', 'redux-thunk']
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user