html-bundler-webpack-plugin
Advanced tools
Comparing version 1.7.0 to 1.8.0
# Change log | ||
## 1.8.0 (2023-03-18) | ||
- feat: add `asset/source` support for SVG to inline it in HTML | ||
- test: add test to inline SVG using the `asset/source` type | ||
## 1.7.0 (2023-03-17) | ||
@@ -4,0 +8,0 @@ - feat: add hot update file to HTML in serv mode when there is no script in template, to reload page after changes |
{ | ||
"name": "html-bundler-webpack-plugin", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"description": "HTML bundler plugin for webpack handels HTML template as entry point, extracts CSS and JS from their sources specified in HTML.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -309,3 +309,3 @@ const vm = require('vm'); | ||
if (type === 'asset/inline' || type === 'asset') { | ||
if (type === 'asset/inline' || type === 'asset' || (type === 'asset/source' && AssetInline.isSvgFile(resource))) { | ||
AssetInline.add(resource, issuer, Options.isEntry(issuer)); | ||
@@ -563,2 +563,14 @@ } | ||
} | ||
} else if (module.type === 'asset/source') { | ||
// support the source type for SVG only | ||
if (AssetInline.isSvgFile(sourceFile)) { | ||
AssetInline.render({ module, chunk, codeGenerationResults, issuerAssetFile: entry.filename }); | ||
if (verbose) { | ||
verboseList.add({ | ||
type: module.type, | ||
sourceFile: sourceRequest, | ||
}); | ||
} | ||
} | ||
} | ||
@@ -565,0 +577,0 @@ } |
255586
4595