From 82fd2a155567da2381cf5c5e6ed963cd5f93b775 Mon Sep 17 00:00:00 2001 From: hoo00nn Date: Wed, 13 Mar 2024 00:57:56 +0900 Subject: [PATCH 1/2] fix: ensure compatibility with ES and CommonJS module systems for StatoscopeWebpackPlugin --- packages/webpack-why/index.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/webpack-why/index.js b/packages/webpack-why/index.js index 05eefb93..375be0ac 100644 --- a/packages/webpack-why/index.js +++ b/packages/webpack-why/index.js @@ -1,7 +1,8 @@ -import StatoscopeWebpackPlugin from '@statoscope/webpack-plugin' +import _StatoscopeWebpackPlugin from '@statoscope/webpack-plugin' import { join } from 'node:path' function addStatoscope(limitConfig, check, webpackConfig) { + const StatoscopeWebpackPlugin = _StatoscopeWebpackPlugin.default ?? _StatoscopeWebpackPlugin if (limitConfig.why) { let shouldOpen = process.env.NODE_ENV !== 'test' && !limitConfig.saveBundle From 049fc2db827abdb290da808585e08d3c0159977a Mon Sep 17 00:00:00 2001 From: hoo00nn Date: Wed, 13 Mar 2024 01:21:16 +0900 Subject: [PATCH 2/2] fix lint rule error --- packages/webpack-why/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/webpack-why/index.js b/packages/webpack-why/index.js index 375be0ac..aefdbf17 100644 --- a/packages/webpack-why/index.js +++ b/packages/webpack-why/index.js @@ -2,7 +2,7 @@ import _StatoscopeWebpackPlugin from '@statoscope/webpack-plugin' import { join } from 'node:path' function addStatoscope(limitConfig, check, webpackConfig) { - const StatoscopeWebpackPlugin = _StatoscopeWebpackPlugin.default ?? _StatoscopeWebpackPlugin + let StatoscopeWebpackPlugin = _StatoscopeWebpackPlugin.default ? _StatoscopeWebpackPlugin.default : _StatoscopeWebpackPlugin; if (limitConfig.why) { let shouldOpen = process.env.NODE_ENV !== 'test' && !limitConfig.saveBundle