Skip to content

Commit 7424724

Browse files
committed
fix: rollback to previous check for fs
1 parent e53ec6c commit 7424724

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/BundleAnalyzerPlugin.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,15 @@ class BundleAnalyzerPlugin {
3131
}
3232

3333
apply(compiler) {
34-
const isWebpack5 = !!(compiler.webpack);
34+
const isFromWebpackDevServer = process.env.WEBPACK_SERVE === 'true';
3535

3636
this.compiler = compiler;
3737

3838
this.logger = require('webpack/lib/logging/runtime')?.getLogger(PLUGIN_NAME)
3939
|| new Logger(this.opts.logLevel);
4040

4141
const done = (stats, callback) => {
42-
this.fs = isWebpack5 ? compiler.outputFileSystem : require('fs');
42+
this.fs = isFromWebpackDevServer ? compiler.outputFileSystem : require('fs');
4343
callback = callback || (() => {});
4444

4545
const actions = [];

0 commit comments

Comments
 (0)