首先配置webpack配置文件: ./config/dev.js
const path = require("path");
const WebpackHtmlPlugin = require('webpack-html-plugin');
//配置webpack-html-plugin 插件
const webpackHtmlPlugin = new WebpackHtmlPlugin({
filename:"index.html",
template:path.resolve(__dirname,"../","index.html"),
inject:"body"
});
module.exports