updated webpack config
This commit is contained in:
parent
b4d3e8a0be
commit
81edb47e41
5 changed files with 42 additions and 2630 deletions
2591
build/server.js
2591
build/server.js
File diff suppressed because it is too large
Load diff
|
@ -15717,8 +15717,10 @@ var reduxMiddleware = window.__REDUX_DEVTOOLS_EXTENSION__ ? (0, _redux.compose)(
|
||||||
// create teh store
|
// create teh store
|
||||||
var store = void 0;
|
var store = void 0;
|
||||||
if (preloadedState) {
|
if (preloadedState) {
|
||||||
|
console.log('initial load: preloaded state found');
|
||||||
store = (0, _redux.createStore)(_reducers2.default, preloadedState, reduxMiddleware);
|
store = (0, _redux.createStore)(_reducers2.default, preloadedState, reduxMiddleware);
|
||||||
} else {
|
} else {
|
||||||
|
console.log('initial load: no preloaded state found');
|
||||||
store = (0, _redux.createStore)(_reducers2.default, reduxMiddleware);
|
store = (0, _redux.createStore)(_reducers2.default, reduxMiddleware);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,10 @@ const reduxMiddleware = window.__REDUX_DEVTOOLS_EXTENSION__ ? compose(middleware
|
||||||
// create teh store
|
// create teh store
|
||||||
let store;
|
let store;
|
||||||
if (preloadedState) {
|
if (preloadedState) {
|
||||||
|
console.log('initial load: preloaded state found');
|
||||||
store = createStore(Reducer, preloadedState, reduxMiddleware);
|
store = createStore(Reducer, preloadedState, reduxMiddleware);
|
||||||
} else {
|
} else {
|
||||||
|
console.log('initial load: no preloaded state found');
|
||||||
store = createStore(Reducer, reduxMiddleware);
|
store = createStore(Reducer, reduxMiddleware);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,46 +5,44 @@ const REACT_ROOT = Path.resolve(__dirname, 'react/');
|
||||||
console.log('REACT_ROOT:', REACT_ROOT);
|
console.log('REACT_ROOT:', REACT_ROOT);
|
||||||
|
|
||||||
module.exports = [
|
module.exports = [
|
||||||
|
// {
|
||||||
|
// target: 'web',
|
||||||
|
// entry : ['babel-polyfill', 'whatwg-fetch', './react/client.js'],
|
||||||
|
// output: {
|
||||||
|
// path : Path.join(__dirname, 'public/bundle/'),
|
||||||
|
// publicPath: 'public/bundle/',
|
||||||
|
// filename : 'bundle.js',
|
||||||
|
// },
|
||||||
|
// watch : true,
|
||||||
|
// module: {
|
||||||
|
// loaders: [
|
||||||
|
// {
|
||||||
|
// test : /.jsx?$/,
|
||||||
|
// loader : 'babel-loader',
|
||||||
|
// exclude: /node_modules/,
|
||||||
|
// query : {
|
||||||
|
// presets: ['es2015', 'react', 'stage-2'],
|
||||||
|
// },
|
||||||
|
// },
|
||||||
|
// ],
|
||||||
|
// },
|
||||||
|
// resolve: {
|
||||||
|
// modules: [
|
||||||
|
// REACT_ROOT,
|
||||||
|
// 'node_modules',
|
||||||
|
// __dirname,
|
||||||
|
// ],
|
||||||
|
// extensions: ['.js', '.jsx', '.scss'],
|
||||||
|
// },
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
target: 'web',
|
target : 'node',
|
||||||
entry : ['babel-polyfill', 'whatwg-fetch', './react/client.js'],
|
externals: [nodeExternals()],
|
||||||
output: {
|
entry : ['./server.js'],
|
||||||
path : Path.join(__dirname, 'public/bundle/'),
|
|
||||||
publicPath: 'public/bundle/',
|
|
||||||
filename : 'bundle.js',
|
|
||||||
},
|
|
||||||
watch : true,
|
|
||||||
module: {
|
|
||||||
loaders: [
|
|
||||||
{
|
|
||||||
test : /.jsx?$/,
|
|
||||||
loader : 'babel-loader',
|
|
||||||
exclude: /node_modules/,
|
|
||||||
query : {
|
|
||||||
presets: ['es2015', 'react', 'stage-2'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
resolve: {
|
|
||||||
modules: [
|
|
||||||
REACT_ROOT,
|
|
||||||
'node_modules',
|
|
||||||
__dirname,
|
|
||||||
],
|
|
||||||
extensions: ['.js', '.jsx', '.scss'],
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
target: 'node',
|
|
||||||
node : {
|
|
||||||
__dirname: true,
|
|
||||||
},
|
|
||||||
externals: nodeExternals(),
|
|
||||||
entry : ['./index.js'],
|
|
||||||
output : {
|
output : {
|
||||||
path : Path.join(__dirname, 'build/'),
|
path : Path.resolve(__dirname),
|
||||||
filename: 'server.js',
|
publicPath: '/',
|
||||||
|
filename : 'serverBundle.js',
|
||||||
},
|
},
|
||||||
watch : true,
|
watch : true,
|
||||||
module: {
|
module: {
|
||||||
|
@ -54,7 +52,7 @@ module.exports = [
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
loader : 'babel-loader',
|
loader : 'babel-loader',
|
||||||
options: {
|
options: {
|
||||||
presets: ['es2015'],
|
presets: ['es2015', 'react', 'stage-2'],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -65,6 +63,7 @@ module.exports = [
|
||||||
},
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
modules: [
|
modules: [
|
||||||
|
REACT_ROOT,
|
||||||
'node_modules',
|
'node_modules',
|
||||||
__dirname,
|
__dirname,
|
||||||
],
|
],
|
||||||
|
|
Loading…
Reference in a new issue