Closed silverwind closed 3 years ago
I think the root cause is webpack's optimizing away the context information about ES module imports, so LicenseWebpackPlugin doesn't know where the ES modules came from. I will see if I can add a hook to the parser to catch these imports.
I fixed it by traversing the webpack stats instead. Please give it a try with v2.3.8 Thanks for your support
Thanks, can confirm those d3 and vue packages now show up and the output looks very close to before.
Oh, and one more minor thing: Previously webpack
itself was listed, but it seems gone currently. I guess it should be included because it has a small amount of runtime code for the lazy loading.
Webpack reports its runtime differently in webpack v5. I have pushed a fix for that too. Try it out in v2.3.9
Webpack is back in the output, thanks. Seems all my issues are resolved, thanks again.
Not sure if this is really actionable but I noticed some modules are not being detected on Webpack 5 that were found on Webpack4:
license-webpack-plugin@2.3.1
onwebpack@4.44.4
license-webpack-plugin@2.3.7
onwebpack@5.11.0
First, there is
vue
andvue-loader
, loaded viaimport Vue from 'vue'
and forvue-loader
in webpack config as loader for.vue
files. Both are present on Webpack 4, absent on 5.Secondly there are a lot of d3 dependencies missing, we import mermaid using
await import('mermaid')
which depends on d3 which depends on a whole lot of modules liked3-array
and it's these modules that are all absent in 5 but were there in 4. Bothmermaid
andd3
are being detected fine.