首页 > Web开发 > 详细

html-webpack-plugin

时间:2020-03-15 13:43:17      阅读:90      评论:0      收藏:0      [点我收藏+]

安装:cnpm install html-webpack-plugin -D

使用:在webpack.config.js文件里面添加配置:

   const htmlWebpackPlugin = require(‘html-webpack-plugin‘)

   module.exports = {

      plugins: [

        new htmlWebpackPlugin({

          template: path.join(__dirname, ‘./src/index.html‘),

          filename: ‘index.html‘

        })

      ]

   }

作用:

  1. 在内存中生成index.html页面
  2. 自动在index.html页面引入bundle

html-webpack-plugin

原文:https://www.cnblogs.com/sunshinexiu/p/12496948.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!