[FEATURE] Umnask comment marker

This commit is contained in:
Philipp Dieter 2018-11-22 02:12:26 +01:00
parent 1af08b69ee
commit b9984b40ec

View File

@ -59,6 +59,7 @@ HtmlWebpackAlterDataPlugin.prototype.apply = function (compiler) {
compilation.hooks.htmlWebpackPluginAfterHtmlProcessing.tapAsync('HtmlWebpackAlterDataPlugin', (data, cb) => { compilation.hooks.htmlWebpackPluginAfterHtmlProcessing.tapAsync('HtmlWebpackAlterDataPlugin', (data, cb) => {
if ('chunkFilenameReplacement' in this.options) { if ('chunkFilenameReplacement' in this.options) {
console.log(data.html)
var co = cheerio.load(data.html, { var co = cheerio.load(data.html, {
recognizeSelfClosing: false, recognizeSelfClosing: false,
lowerCaseTags: false, lowerCaseTags: false,
@ -82,6 +83,8 @@ HtmlWebpackAlterDataPlugin.prototype.apply = function (compiler) {
data.html = co.html() data.html = co.html()
} }
data.html = data.html.replace('<!DOCTYPE html5>', '<!DOCTYPE html>') data.html = data.html.replace('<!DOCTYPE html5>', '<!DOCTYPE html>')
data.html = data.html.replace(/<!--\|\%\|/g, '')
data.html = data.html.replace(/\|\%\|-->/g, '')
cb(null, data) cb(null, data)
}) })