-
Notifications
You must be signed in to change notification settings - Fork 75
/
webpack.config.js
82 lines (80 loc) · 1.97 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
const path = require('path');
const { CleanWebpackPlugin } = require('clean-webpack-plugin');
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = (env) => {
const isEnvProduction = !!env && env.production;
console.log('Production: ', isEnvProduction);
return {
devtool: 'cheap-module-eval-source-map',
entry: './src/index.jsx',
devtool: 'source-map',//eval | source-map
module: {
rules: [
{
test: /\.(js|jsx)$/,
exclude: /node_modules/,
use: ['babel-loader']
}, {
test: /\.(scss|less|css)$/,
use: ['style-loader', 'css-loader', 'sass-loader']
},
{
test: /\.(png|jpe?g|gif|svg)$/i,
use: [
{
loader: 'file-loader',
},
],
},
]
},
resolve: {
extensions: ['*', '.js', '.jsx', '.ts']
},
output: {
path: __dirname + '/dist',
publicPath: '/',
filename: 'ion-conference.[hash].js'
},
plugins: [
new CleanWebpackPlugin(),
new HtmlWebpackPlugin(
Object.assign(
{},
{
inject: true,
template: path.resolve(__dirname, "public/index.html"),
},
isEnvProduction
? {
minify: {
removeComments: true,
collapseWhitespace: true,
removeRedundantAttributes: true,
useShortDoctype: true,
removeEmptyAttributes: true,
removeStyleLinkTypeAttributes: true,
keepClosingSlash: true,
minifyJS: true,
minifyCSS: true,
minifyURLs: true,
},
}
: undefined
)),
],
devServer: {
hot: true,
disableHostCheck: true,
proxy: {
'/biz.Biz/Signal': {
target: 'ws://localhost:5551',
ws: true
},
'/sfu.SFU/Signal': {
target: 'ws://localhost:5551',
ws: true
},
},
}
}};