index.js
939 Bytes
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
const path = require("path");
const loaders = require("./loaders");
const plugins = require("./plugins");
const NODE_ENV = process.env.NODE_ENV
const distPath = NODE_ENV == 'development' ? '../dist' : '../build'
module.exports = {
entry: {
index: "./src/index.js",
},
devtool: "inline-source-map",
module: loaders,
plugins,
resolve: {
extensions: [ ".js", ".wasm" ],
},
output: {
filename: "[name].[hash].js",
path: path.resolve(__dirname, distPath),
},
optimization: {
minimize: false,
},
devServer: {
overlay: {
warnings: true,
errors: true,
},
hot: true,
contentBase: path.join(__dirname, "./"),
compress: true,
progress: true,
open: true,
proxy: {
'/openday-boot': {
target: 'https://openday.console.etoneiot.tech', // 请求本地 需要openday-boot后台项目
ws: true,
changeOrigin: true
}
}
},
};