Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8be0f81

Browse files
committed
fix: duplicated style at webpack watch mode
fix #30 and #13
1 parent 0a67099 commit 8be0f81

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

‎src/core/v4.ts‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ export class PluginForHtmlWebpackPluginV4 extends BasePlugin {
3232
private cssStyleMap: Map<HTMLWebpackPlugin, CSSStyle[]> = new Map()
3333

3434
private prepareCSSStyle(data: BeforeAssetTagGenerationData) {
35+
// `prepareCSSStyle` may be called more than once in webpack watch mode.
36+
// https://github.com/Runjuu/html-inline-css-webpack-plugin/issues/30
37+
// https://github.com/Runjuu/html-inline-css-webpack-plugin/issues/13
38+
this.cssStyleMap.clear()
39+
3540
const [...cssAssets] = data.assets.css
3641
cssAssets.forEach((cssLink) => {
3742
if (this.isCurrentFileNeedsToBeInlined(cssLink)) {

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /