-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathwebpack.config.js
More file actions
45 lines (42 loc) · 1.07 KB
/
webpack.config.js
File metadata and controls
45 lines (42 loc) · 1.07 KB
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
'use strict';
var path = require('path');
const webpack = require('webpack'); //to access built-in plugins
module.exports = {
mode: 'development',
context: __dirname,
entry: './src/index.js',
module: {
rules: [{ test: /\.css$/, use: 'raw-loader' }],
},
plugins: [
new webpack.DefinePlugin({
'process.env.HOST': JSON.stringify(process.env.HOST)
})
],
devServer: {
static: {
directory: path.resolve(__dirname, ''),
},
hot: true,
open: false,
compress: true,
historyApiFallback: true,
allowedHosts: [
'jstris.jezevec10.com'
],
client: {
webSocketURL: 'ws://localhost:8080/ws',
},
},
output: {
path: __dirname,
publicPath: '/',
filename: 'bundle.js'
},
optimization: {
minimize: false,
}
};
if(process.env.NODE_ENV === 'development')
//module.exports.devtool = 'cheap-module-eval-source-map';
module.exports.devtool = 'eval-cheap-module-source-map';