WEBPACK html-include-loader 支持通过标签包含HTML文件
<include src="header.html" />
npm install html-loader --save-dev
npm install @joyzl/html-include-loader --save-dev
webpack.config.js 中配置规则
module: {
rules: [{
test: /\.html$/i,
use: ['html-loader', '@joyzl/html-include-loader'],
}]
}
尽情创建多页面吧!!!