-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwebpack.config.development.js
54 lines (52 loc) · 1.29 KB
/
webpack.config.development.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
const path = require('path')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const host = '0.0.0.0'
const port = 3000
module.exports = {
entry: [`webpack-dev-server/client?http://${host}:${port}`, path.resolve(__dirname, 'src/index')],
plugins: [
new HtmlWebpackPlugin({
inject: 'body',
template: path.resolve(__dirname, 'src/template.ejs'),
poster: {},
}),
],
module: {
rules: [
{
test: /\.js$/,
use: 'babel-loader',
exclude: /node_modules/,
},
{
test: /\.(png|otf)$/,
use: 'file-loader',
},
{
test: /\.svg$/,
use: 'svg-sprite-loader',
},
{
test: /\.po$/,
use: 'react-localized-loader',
},
],
},
resolve: {
alias: {
assets: path.resolve(__dirname, 'src/assets'),
components: path.resolve(__dirname, 'src/components'),
constants: path.resolve(__dirname, 'src/constants'),
data: path.resolve(__dirname, 'src/data'),
hooks: path.resolve(__dirname, 'src/hooks'),
locales: path.resolve(__dirname, 'src/locales'),
providers: path.resolve(__dirname, 'src/providers'),
utils: path.resolve(__dirname, 'src/utils'),
},
},
devServer: {
host,
port,
historyApiFallback: true,
},
}