-
-
Notifications
You must be signed in to change notification settings - Fork 488
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow disabling of bundleDir from plugin option #274
Comments
The simplest way to get Nuxt unblocked could be to amend that conditional to also list Would you be open to create such a PR? |
Hi @valscion, thanks for the prompt response. I have created 2 PRs for this issue
Would like to have your opinion on which PR is more suitable for |
Let's go with #275 first as I'm a bit wary on adding new configuration options for something that seems to be quite an edge case. I'd like us to see more concrete use cases than Nuxt before adding a new config option EDIT: Linked to wrong PR first because you had also put the wrong PR numbers in your message 😄 |
Fixed in #275 |
Issue description
Allow us to disable/overwrite
bundleDir
in the plugin optionCurrently
bundleDir
can only be defined in via the command line. In pluginbundleDir
is decided in the following logicwebpack-bundle-analyzer/src/BundleAnalyzerPlugin.js
Lines 130 to 132 in 1c8aba3
However,
compiler.outputFileSystem
might not always beMemoryFileSystem
.Use case:
The framework
Nuxt 2.5.0
replaceMemoryFileSystem
with their own implementation ofAsyncMFS
, which extendMemoryFileSystem
, during development.Current problem
This cause
compiler.outputFileSystem.constructor.name
to be"AsyncMFS"
, thus causinggetBundleDirFromCompiler
to returnthis.compiler.outputPath
.Expected behavior
The expectation result here is
null
. Since nuxt is usingwebpack-dev-server
during development and no real file is being created.My thoughts
I am not sure if it is possible to detect if real file is created in this case. It might not be reasonable for
webpack-bundle-analyzer
to keep track of a list ofoutputFileSystem.constructor.name
that should makebundleDir
tonull
.Thus I am proposing
webpack-bundle-analyzer
to allow us to overwritebundleDir
tonull
in the plugin optionTechnical info
Debug info
How do you use this module? As CLI utility or as plugin?
If CLI, what command was used? (e.g.
webpack-bundle-analyzer -O path/to/stats.json
)If plugin, what options were provided? (e.g.
new BundleAnalyzerPlugin({ analyzerMode: 'disabled', generateStatsFile: true })
)What other Webpack plugins were used?
It would be nice to also attach webpack stats file.
It can be generated using these options:
stats.json
will be created in Webpack bundle output directory.The text was updated successfully, but these errors were encountered: