From 306fb1c097eec45df3f51f6c98cb4c70d2eccca1 Mon Sep 17 00:00:00 2001 From: evankwolf <452367115@qq.com> Date: Sun, 19 Feb 2023 12:14:12 +0800 Subject: [PATCH] fix: resolve conflict with htmlwebpackplugin when using es6 template string --- src/loaders/windicss-template.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/loaders/windicss-template.ts b/src/loaders/windicss-template.ts index 4468b33..0300264 100644 --- a/src/loaders/windicss-template.ts +++ b/src/loaders/windicss-template.ts @@ -40,7 +40,7 @@ function WindicssTemplate( * Source: html-webpack-plugin/lib/loader.js */ const options = this.query !== '' ? loaderUtils.parseQuery(this.query) : {} - const template = compileTemplate(source, defaults(options, { variable: 'data' })) + const template = compileTemplate(source, defaults(options, { interpolate: /<%=([\s\S]+?)%>/g, variable: 'data' })) // Require !!lodash - using !! will disable all loaders (e.g. babel) return `var _ = require(${loaderUtils.stringifyRequest(this, `!!${require.resolve('lodash')}`)});` + 'module.exports = function (templateParams) { with(templateParams) {'