feat(client-routes): Add react-router-dom for client-side routing

This commit is contained in:
Stuart Taylor
2018-08-01 12:40:44 +01:00
committed by mrugesh mohapatra
parent 5cf5979563
commit 1b18594bd3
13 changed files with 265 additions and 42 deletions

View File

@@ -10,7 +10,7 @@ var __DEV__ = process.env.NODE_ENV !== 'production';
module.exports = {
entry: {
client: './client/index.js',
news: './news/index.js'
news: './news/client.js'
},
devtool: __DEV__ ? 'inline-source-map' : 'source-map',
mode: __DEV__ ? 'development' : 'production',
@@ -23,21 +23,18 @@ module.exports = {
},
output: {
filename: __DEV__ ? '[name]-app.js' : '[name]-app-[hash].js',
chunkFilename: __DEV__ ?
'[name]-chunk.js' :
'[name]-chunk-[chunkhash].js',
chunkFilename: __DEV__ ? '[name]-chunk.js' : '[name]-chunk-[chunkhash].js',
path: path.join(__dirname, '/public/js/'),
publicPath: '/js'
},
module: {
rules: [{
test: /\.jsx?$/,
exclude: /node_modules/,
use: [
__DEV__ && 'react-hot-loader',
'babel-loader'
].filter(Boolean)
}]
rules: [
{
test: /\.jsx?$/,
exclude: /node_modules/,
use: [__DEV__ && 'react-hot-loader', 'babel-loader'].filter(Boolean)
}
]
},
plugins: [
new webpack.DefinePlugin({