lhl 6ff0e96ad3 8-4-1 | hai 1 ano | |
---|---|---|
.. | ||
build | hai 1 ano | |
README.md | hai 1 ano | |
main.js | hai 1 ano | |
template.ejs | hai 1 ano | |
webpack.config.js | hai 1 ano |
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>
).
...
<body>
<% if (htmlWebpackPlugin.files.sprites) { %>
<% for (var spriteFileName in htmlWebpackPlugin.files.sprites) { %>
<%= htmlWebpackPlugin.files.sprites[spriteFileName] %>
<% } %>
<% } %>
</body>
...