-
Notifications
You must be signed in to change notification settings - Fork 7
/
webpack.client.dev.js
37 lines (36 loc) · 1.11 KB
/
webpack.client.dev.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
const webpack = require('webpack')
const path = require('path')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')
const LoadablePlugin = require('@loadable/webpack-plugin')
const { paths } = require('../scripts/utils')
const ReactRefreshWebpackPlugin = require('@pmmmwh/react-refresh-webpack-plugin')
module.exports = {
mode: 'development',
target: 'web',
devtool: 'source-map',
entry: {
bundle: [paths.srcClient]
},
output: {
path: path.join(paths.clientBuild, paths.publicPath),
filename: 'bundle.js',
publicPath: paths.publicPath
},
resolve: {
modules: [paths.src, 'node_modules'],
extensions: ['.js', '.jsx', '.ts', '.tsx']
},
module: require('./loaders.client.js'),
plugins: [
new LoadablePlugin(),
new ReactRefreshWebpackPlugin(),
new MiniCssExtractPlugin(),
new webpack.HotModuleReplacementPlugin(),
new webpack.DefinePlugin({
'process.env.BROWSER': 'true',
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV),
'process.env.BACKEND_BASE_URL': JSON.stringify(process.env.BACKEND_BASE_URL)
})
],
stats: 'minimal'
}