From b3aeee54e615f7ccf27094ad327c566725faa0b9 Mon Sep 17 00:00:00 2001 From: Camo <669762172@qq.com> Date: Sat, 10 Jul 2021 16:54:41 +0800 Subject: [PATCH] fix bug: Compatible with the condition that the HTML webpack plugin inject option value is false --- src/core/base-plugin.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/base-plugin.ts b/src/core/base-plugin.ts index 9dbb986..e3ec35b 100644 --- a/src/core/base-plugin.ts +++ b/src/core/base-plugin.ts @@ -97,9 +97,7 @@ export class BasePlugin { } if (html.indexOf(this.replaceConfig.target) === -1) { - throw new Error( - `Can not inject css style into "${htmlFileName}", as there is not replace target "${this.replaceConfig.target}"`, - ) + return replaceValues.join(''); } return html.replace(this.replaceConfig.target, replaceValues.join(''))