htc 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 mesi fa
..
build 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 mesi fa
README.md 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 mesi fa
main.js 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 mesi fa
template.ejs 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 mesi fa
webpack.config.js 7ca38fdcbb 善行少年PC端首次提交(基础版) 10 mesi fa

README.md

HTML webpack plugin interop

When using html-webpack-plugin along with sprite-loader in extract mode it is possible to inline sprite content directly to the page. All extracted sprites stored in htmlWebpackPlugin.files.sprites template variable. It's an object where key is a sprite filename and value - file contents (Object<filename:string, content:string>).

Demo

Template example

...
<body>

<% if (htmlWebpackPlugin.files.sprites) { %>
  <% for (var spriteFileName in htmlWebpackPlugin.files.sprites) { %>
    <%= htmlWebpackPlugin.files.sprites[spriteFileName] %>
  <% } %>
<% } %>

</body>
...