您现在的位置是:首页 > web开发 > webpack 打包html文件

webpack 打包html文件

web开发作者:dayu日期:5天前点击:0

1、安装webpack-html-plugin模块

$ npm install webpack-html-plugin —save-dev

2webpack.config.js文件写入

var WebpackHtmlPlugin = require(‘webpack-html-plugin‘);

output: {

path: path.resolve(__dirname, ‘./dist‘),

publicPath: ‘/dist/‘,

filename: ‘[name].js‘

},

plugins: [

new WebpackHtmlPlugin({

template:‘forgetPass.html‘,

filename:‘forgetPass.html‘

}),

new WebpackHtmlPlugin({

template:’app/utils/crawTask/crawTaskProcess/websiteRange/failSheet.html’,

filename:‘utils/crawTask/crawTaskProcess/websiteRange/failSheet.html‘

})

]

webpack 打包html文件

原文地址:http://www.cnblogs.com/respect2017/p/7238975.html


下一篇       上一篇