/* * @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: 'localhost', //服务端压缩是否开启 compress: true, //配置服务端口号 port: 8011, // 代理配置 proxy:{ "/flb/cab": { // 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, } });