const path = require('path'); module.exports = { mode:'development', entry:{ main:'./src/main.js', }, output:{ path:path.resolve(__dirname,'../dist'), //打包的路径(绝对路径) filename:'[name].js' //按入口文件命名打包成的文件名 }, //模块 module:{ rules:[] }, plugins:[], //插件 //服务功能配置 devServer:{ contentBase:path.resolve(__dirname,'../dist'), //基本目录结构 host:'localhost', //ip地址 compress:true, //开启服务器端压缩 port:8888 //端口 } //服务功能配置 }