码迷,mamicode.com
首页 > Web开发 > 详细

webpack 打包html文件

时间:2017-07-26 13:43:57      阅读:260      评论:0      收藏:0      [点我收藏+]

标签:文件   font   var   raw   out   文件写入   process   space   indent   

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文件

标签:文件   font   var   raw   out   文件写入   process   space   indent   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!