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
|
/* eslint-env node */
const path = require('path');
const dotenv = require('dotenv')
const webpack = require('webpack')
// this will update the process.env with environment variables in .env file
dotenv.config();
module.exports = {
entry: {
ui: './webAO/ui.js',
client: './webAO/client.js',
master: './webAO/master.js',
},
output: {
path: path.resolve(__dirname, 'webAO'),
filename: '[name].b.js',
},
module: {
rules: [
{
test: /\.m?js$/,
exclude: /(node_modules|bower_components)/,
use: {
loader: 'babel-loader',
options: {
presets: [
[
'@babel/preset-env', {
useBuiltIns: 'usage',
targets: [
'defaults',
'Safari > 3',
'Opera > 8',
'Android > 3',
],
corejs: 3,
},
],
],
},
},
},
],
},
performance: {
hints: false,
maxEntrypointSize: 512000,
maxAssetSize: 512000
},
plugins: [
new webpack.DefinePlugin({
'process.env': JSON.stringify(process.env)
})
],
devtool: 'source-map',
mode: 'production',
};
|