/* * @Author: 小明丶 * @Date: 2019-08-19 15:23:18 * @LastEditors: zxq * @LastEditTime: 2022-08-03 17:17:40 * @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: 8020, // 代理配置 proxy:{ "/aic": { target: 'https://t.finlean.com', ws: true, changeOrigin: true }, "/image": { target: 'https://t.finlean.com', ws: true, changeOrigin: true }, '/jttech': { target: 'https://t.finlean.com', secure: false, changeOrigin: true } } }, plugins: [ new webpack.HotModuleReplacementPlugin(), ], watchOptions: { //不监听的目录 ignored: /node_modules/, //当第一个文件更改,会在重新构建前增加延迟。这个选项允许 webpack 将这段时间内进行的任何其他更改都聚合到一次重新构建里。 aggregateTimeout:800, // 通过传递 true 开启 polling,或者指定毫秒为单位进行轮询。 // poll:1000, } });