-
Notifications
You must be signed in to change notification settings - Fork 5
/
webpack.config.js
46 lines (45 loc) · 1.34 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
const path = require('path');
const HtmlWebpackPlugin = require('html-webpack-plugin');
module.exports = function(env) {
return {
entry: './src/js/chat.js',
mode: env.target === 'dev' ? 'development' : 'production',
output: env.target === 'prod' ? {publicPath: 'static/'} : {},
module: {
rules: [
{
test: /\.(png|jpg|gif|svg|mp3|ttf)$/,
type: 'asset/resource',
},
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
}
]
},
devServer: {
static: [path.join(__dirname, 'www-dev')],
port: 9000,
hot: false,
proxy: [
{
context: ['/get', '/post', '/login', '/authenticate.php', '/eterna_logout.php'],
target: 'https://eternagame.org',
changeOrigin: true,
}
],
},
plugins: [
new HtmlWebpackPlugin({
template: './src/chat.html',
filename: 'chat.html',
scriptLoading: 'blocking',
})
],
optimization: {
splitChunks: {
chunks: 'all',
},
},
}
};