You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					24 lines
				
				702 B
			
		
		
			
		
	
	
					24 lines
				
				702 B
			| 
								 
											4 years ago
										 
									 | 
							
								# HTML webpack plugin interop
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								When using [html-webpack-plugin](https://github.com/jantimon/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](build/index.html)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								### Template example
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								```ejs
							 | 
						||
| 
								 | 
							
								...
							 | 
						||
| 
								 | 
							
								<body>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								<% if (htmlWebpackPlugin.files.sprites) { %>
							 | 
						||
| 
								 | 
							
								  <% for (var spriteFileName in htmlWebpackPlugin.files.sprites) { %>
							 | 
						||
| 
								 | 
							
								    <%= htmlWebpackPlugin.files.sprites[spriteFileName] %>
							 | 
						||
| 
								 | 
							
								  <% } %>
							 | 
						||
| 
								 | 
							
								<% } %>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								</body>
							 | 
						||
| 
								 | 
							
								...
							 | 
						||
| 
								 | 
							
								```
							 |