1.学习地址
中文文档
https://www.webpackjs.com/concepts/
webpack-dev-server配置说明
https://www.webpackjs.com/configuration/dev-server/
demo测试地址
https://github.com/ruanyf/webpack-demos
2.一些概念与问题
webpack 是一个现代 JavaScript 应用程序的静态模块打包器(module bundler)。
webpack-dev-server为你提供了一个简单的 web 服务器,并且能够实时重新加载(live reloading)。
web 服务器入口:devServer.index
index: 'index.html'
简单配置:
module.exports = { entry: './main.js', output: { filename: 'bundle.js' }, devServer: { port: 9000, //端口改为9000 open:true, // 自动打开浏览器 index:'index.html' } };