-
Notifications
You must be signed in to change notification settings - Fork 2
/
webpack.config.js
123 lines (122 loc) · 2.98 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const WebpackPwaManifest = require('webpack-pwa-manifest');
module.exports = {
mode: 'development',
entry: ['babel-polyfill', './client/src/app/index.jsx'],
output: {
path: path.join(__dirname, 'dist'),
filename: 'bundle.js',
publicPath: '/'
},
resolve: {
modules: [
path.resolve(__dirname, 'client', 'src'),
'tests',
'node_modules'
],
extensions: ['.js', '.jsx']
},
module: {
rules: [
{
test: /\.(jsx?)$/,
exclude: /node_modules/,
use: {
loader: 'babel-loader',
options: {
plugins: ['babel-plugin-jsx-remove-data-test-id']
}
}
},
{
test: /\.s?css$/,
use: [
'style-loader',
'css-loader',
'postcss-loader',
{
loader: 'sass-loader',
options: {
sassOptions: {
includePaths: ['./client/src/app/styles']
}
}
}
]
},
{
test: /\.(woff|woff2|eot|ttf|svg)$/,
loader: 'url-loader?limit=100000'
},
{
test: /\.(png|jpg)$/,
use: 'file-loader'
},
{
test: /\.md$/,
use: [{ loader: 'html-loader' }, { loader: 'markdown-loader' }]
}
]
},
devServer: {
port: 3000,
open: true,
inline: true,
hot: true,
disableHostCheck: true,
proxy: {
'/api': 'http://localhost:8080',
'/auth': 'http://localhost:8080',
'/socket.io': { target: 'http://localhost:8080', ws: true }
},
watchOptions: {
ignored: /node_modules/
},
historyApiFallback: true
},
plugins: [
new CleanWebpackPlugin({ verbose: true }),
new HtmlWebpackPlugin({
favicon: './client/public/favicon/favicon.ico',
template: './client/public/index.html'
}),
new WebpackPwaManifest({
background_color: '#ffffff',
display: 'standalone',
fingerprints: false,
icons: [
{
sizes: '72x72',
src: path.resolve('./client/public/favicon/android-chrome-72x72.png'),
type: 'image/png'
},
{
sizes: '16x16',
src: path.resolve('./client/public/favicon/favicon-16x16.png'),
type: 'image/png'
},
{
sizes: '32x32',
src: path.resolve('./client/public/favicon/favicon-32x32.png'),
type: 'image/png'
},
{
sizes: '150x150',
src: path.resolve('./client/public/favicon/mstile-150x150.png'),
type: 'image/png'
},
{
ios: true,
sizes: '72x72',
src: path.resolve('./client/public/favicon/apple-touch-icon.png'),
type: 'image/png'
}
],
name: 'End of coffee',
short_name: 'EOC',
theme_color: '#ffffff'
})
]
};