-
-
Notifications
You must be signed in to change notification settings - Fork 408
/
webUISetup.config.js
38 lines (30 loc) · 1.27 KB
/
webUISetup.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
const path = require('path');
const webpack = require("webpack")
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
module.exports = (env) => {
if (env === "test") {
console.log("Loading test env variables")
require("dotenv").config({path: ".env.test"})
} else if (env === "development") {
console.log("Loading development env variables")
require("dotenv").config({path: ".env.development"})
} else {
console.log("Loading production env variables")
require("dotenv").config({path: ".env.production"});
}
return {
entry: './webUISetup/src/index.js',
output: {
path: path.resolve(__dirname, 'webUISetup', "dist"),
filename: 'bundle.js'
},
plugins: [
new webpack.DefinePlugin({
"process.env.PORT": JSON.stringify(process.env.PORT),
"process.env.REMOTE_URL": JSON.stringify(process.env.REMOTE_URL),
"process.env.ENABLE_VIDEO_TRANSCODING": JSON.stringify(process.env.ENABLE_VIDEO_TRANSCODING),
"process.env.DISABLE_STORAGE": JSON.stringify(process.env.DISABLE_STORAGE),
"process.env.SERVER_IP": JSON.stringify(process.env.SERVER_IP)
}),
],
}};