Closed thewebartisan7 closed 11 months ago
Can you share your webpack config? i would assume there is a plugin that is responsible for the html injection part.
Actually it's a bit long and even splitted dev and prod.
However I suppose it's HtmlWebpackPlugin
that is injecting the scripts and css that you are asking for. Right?
One thing, this happen with webpack 4.x
I have recently upgrade to webpack 5.x and I am doing test right now.
Seem that it's doesn't happen with webpack 5.x
that make sense actually, because in Webpack v4 and earlier ignoring an asset is somewhat hacky while in v5 there is an explicit method to do that which probably cleans the asset properly and doesn't leave traces that can later get picked up by other plugins.
Yes I know that it's hacky in v4, and I saw you are using method deleteAsset. I thought the same thing when I see.
There are some workaround for v4 that I try, but none worked.
The ignored JS files are not compiled, but are injected inside html template. It's possible to avoid this?
Thanks