From 4ffac8032248d955b28f150f07cefcd62d4c232d Mon Sep 17 00:00:00 2001 From: Jihun Oh Date: Thu, 14 Mar 2024 00:44:07 +0900 Subject: [PATCH] Fix ensure compatibility with ES and CommonJS module systems for StatoscopeWebpackPlugin (#358) * fix: ensure compatibility with ES and CommonJS module systems for StatoscopeWebpackPlugin * fix lint rule error --------- Co-authored-by: hoo00nn --- 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..aefdbf17 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) { + let StatoscopeWebpackPlugin = _StatoscopeWebpackPlugin.default ? _StatoscopeWebpackPlugin.default : _StatoscopeWebpackPlugin; if (limitConfig.why) { let shouldOpen = process.env.NODE_ENV !== 'test' && !limitConfig.saveBundle