liangjin
2021-04-01 b3d69d1ed5d25ec57cf50e742100a5e4f61b2301
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
/*
 * @Author: 小明丶
 * @Date: 2019-08-19 15:23:18
 * @LastEditors: 小明丶
 * @LastEditTime: 2020-11-20 17:19:45
 * @Description:
 */
//  webpack开发环境配置
const webpack = require('webpack');
const merge = require('webpack-merge');
const common = require('./webpack.common.js');
 
module.exports = merge(common, {
    mode: 'development',
    // 如果大型项目可以使用source-map,如果是中小型项目使用eval-source-map就可以了(方便debug)
    devtool: 'source-map',
    watch: true,
    devServer: {
        contentBase: './dist',
        inline: true,
        hot: true,
        host: '127.0.0.1',
        //服务端压缩是否开启
        compress: true,
        //配置服务端口号
        port: 8011,
        // 代理配置
        proxy:{
            "/sib": {
                // target: 'http://192.168.1.46:8096',
                target: 'https://t.finlean.com',
                // target: 'https://pre.finlean.com',
                // target: 'http://192.168.1.63:8096',
                ws: true,
                changeOrigin: true
            },
            "/image": {
                // target: 'https://pre.finlean.com',
                target: 'https://t.finlean.com',
                ws: true,
                changeOrigin: true
            },
            '/jttech': {
                //target: 'https://pre.finlean.com',
                target: 'https://t.finlean.com',
                secure: false,
                changeOrigin: true
            }
 
        }
    },
    plugins: [
        new webpack.HotModuleReplacementPlugin(),
    ],
    watchOptions: {
        //不监听的目录
        ignored: /node_modules/,
        //当第一个文件更改,会在重新构建前增加延迟。这个选项允许 webpack 将这段时间内进行的任何其他更改都聚合到一次重新构建里。
        aggregateTimeout:800,
        // 通过传递 true 开启 polling,或者指定毫秒为单位进行轮询。
        // poll:1000,
    }
});