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

webpack html-webpack-plugin 遍历

时间:2018-04-04 12:34:31      阅读:555      评论:0      收藏:0      [点我收藏+]

标签:json   param   log   string   module   index   top   des   errors   

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>
<body>
  <%= htmlWebpackPlugin.options.date %>
  <% for(var key in htmlWebpackPlugin.files) { %>
    <%= key %> : <%= JSON.stringify(htmlWebpackPlugin.files[key]) %>
  <% } %>

  <%= htmlWebpackPlugin.options.date %>

  <% for(var key in htmlWebpackPlugin.options) { %>
    <%= key %> : <%= JSON.stringify(htmlWebpackPlugin.options[key]) %>
  <% } %>
</body>
</html>

打包后的结果

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>webpack is very good</title>
<script type="text/javascript" src="js/main-df735bd75d7abb5252d2.js"></script><script type="text/javascript" src="js/a-c21ac76689ad2a5125c6.js"></script></head>
<body>
Wed Apr 04 2018 09:46:54 GMT+0800 (中国标准时间)

publicPath : ""

chunks : {"main":{"size":23,"entry":"js/main-df735bd75d7abb5252d2.js","hash":"df735bd75d7abb5252d2","css":[]},"a":{"size":22,"entry":"js/a-c21ac76689ad2a5125c6.js","hash":"c21ac76689ad2a5125c6","css":[]}}

js : ["js/main-df735bd75d7abb5252d2.js","js/a-c21ac76689ad2a5125c6.js"]

css : []

manifest :

Wed Apr 04 2018 09:46:54 GMT+0800 (中国标准时间)


template : "C:\\Users\\Administrator\\Desktop\\webpackdemo\\node_modules\\html-webpack-plugin\\lib\\loader.js!C:\\Users\\Administrator\\Desktop\\webpackdemo\\index.html"

templateParameters :

filename : "index.html"

hash : false

inject : "head"

compile : true

favicon : false

minify : false

cache : true

showErrors : true

chunks : "all"

excludeChunks : []

chunksSortMode : "auto"

meta : {}

title : "webpack is very good"

xhtml : false

date : "2018-04-04T01:46:54.014Z"

</body>
</html>

 

webpack html-webpack-plugin 遍历

标签:json   param   log   string   module   index   top   des   errors   

原文地址:https://www.cnblogs.com/chenmiaosong/p/8715392.html

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