From 4b054b540b9dae6e7fc01e7698e5e0e1f6cf349f Mon Sep 17 00:00:00 2001 From: Amos Wong Date: Thu, 25 Apr 2019 16:32:10 +0800 Subject: [PATCH 1/3] Add AsyncMFS for getBundleDirFromCompiler --- src/BundleAnalyzerPlugin.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/BundleAnalyzerPlugin.js b/src/BundleAnalyzerPlugin.js index 09d191a7..8877de07 100644 --- a/src/BundleAnalyzerPlugin.js +++ b/src/BundleAnalyzerPlugin.js @@ -128,7 +128,13 @@ class BundleAnalyzerPlugin { } getBundleDirFromCompiler() { - return (this.compiler.outputFileSystem.constructor.name === 'MemoryFileSystem') ? null : this.compiler.outputPath; + switch (this.compiler.outputFileSystem.constructor.name) { + case 'MemoryFileSystem': + case 'AsyncMFS': + return null; + default: + return this.compiler.outputPath; + } } } From a9653ca1a8966b5aa4c3fba063bcb92adf24f570 Mon Sep 17 00:00:00 2001 From: Amos Wong Date: Thu, 25 Apr 2019 22:38:43 +0800 Subject: [PATCH 2/3] Mention usage of AsyncMFS in comment --- src/BundleAnalyzerPlugin.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/BundleAnalyzerPlugin.js b/src/BundleAnalyzerPlugin.js index 8877de07..888296a2 100644 --- a/src/BundleAnalyzerPlugin.js +++ b/src/BundleAnalyzerPlugin.js @@ -130,6 +130,9 @@ class BundleAnalyzerPlugin { getBundleDirFromCompiler() { switch (this.compiler.outputFileSystem.constructor.name) { case 'MemoryFileSystem': + + // Detect AsyncMFS used by Nuxt 2.5 that replaces webpack's MFS during development + // Related: #274 case 'AsyncMFS': return null; default: From 2aba4a3448f99d5bfc96ec1ac5ec0a0d6ad21168 Mon Sep 17 00:00:00 2001 From: Amos Wong Date: Thu, 25 Apr 2019 22:48:36 +0800 Subject: [PATCH 3/3] Remove switch fallthrough for eslint compliance --- src/BundleAnalyzerPlugin.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BundleAnalyzerPlugin.js b/src/BundleAnalyzerPlugin.js index 888296a2..0fa1779d 100644 --- a/src/BundleAnalyzerPlugin.js +++ b/src/BundleAnalyzerPlugin.js @@ -130,7 +130,7 @@ class BundleAnalyzerPlugin { getBundleDirFromCompiler() { switch (this.compiler.outputFileSystem.constructor.name) { case 'MemoryFileSystem': - + return null; // Detect AsyncMFS used by Nuxt 2.5 that replaces webpack's MFS during development // Related: #274 case 'AsyncMFS':