-
Notifications
You must be signed in to change notification settings - Fork 0
/
webpack.config.js
79 lines (76 loc) · 1.64 KB
/
webpack.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
const webpack = require('webpack')
const path = require('path')
const clientConfig = {
devtool: 'cheap-module-source-map',
target: 'web',
entry: [
'react-hot-loader/patch',
'webpack-dev-server/client?http://localhost:3000',
'webpack/hot/only-dev-server',
'./src/client/index.js'
],
output: {
filename: 'bundle.js',
path: path.resolve(__dirname, 'public'),
publicPath: '/static/'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NamedModulesPlugin(),
new webpack.NoEmitOnErrorsPlugin(),
new webpack.DefinePlugin({
API_DEV: JSON.stringify('http://localhost:8080/api')
})
],
module: {
rules: [
{
test: /\.js$/,
loader: 'babel-loader',
exclude: /node_modules/
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}
],
},
devServer: {
historyApiFallback: true,
contentBase: path.join(__dirname, 'public'),
hot: true,
port: 3000,
open: true,
},
performance: {
hints: false,
},
}
/* const serverConfig = {
devtool: 'cheap-module-source-map',
target: 'node',
entry: [
'react-hot-loader/patch',
'./src/server/server'
],
output: {
filename: 'bundle.server.js',
path: path.resolve(__dirname, 'public'),
publicPath: '/static/'
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
new webpack.NoEmitOnErrorsPlugin()
],
module: {
rules: [
{
test: /\.js$/,
loader: ['babel-loader'],
include: path.resolve(__dirname, 'src'),
exclude: /node_modules/
}
],
},
} */
module.exports = clientConfig