terser-webpack-plugin
terser-webpack-plugin copied to clipboard
Missing External Files
Hey guys,
We are trying to exclude some chunky / unnecessary node_modules files from our bundle by adding them to our externals list like so:
externals: [
/pdfmake\.js$/,
/xlsx\.js$/,
/vfs\_fonts$/
],
However, upon adding them to the list, now suddenly we are getting the error:
Failed to minify the code from this file:
pdfmake/vfs_fonts":1
Of course this fails, as this part of the code is no longer included in the bundle / chunks.
Unfortunately adding the same files to exclude within the TerserPlugin config doesn't seem to solve the issue:
exclude: [
/pdfmake\.js$/,
/xlsx\.js$/,
/vfs\_fonts$/
],
This might be because our chunks are already renamed, or because there still remains a dependency? How can we exclude / ignore these files so that we are able to build?
As far as I understand the exclude list doesn't work because the files have already been processed into chunks. It is weird though, that the 'minify code from this file' actually returns the path of a file that actually could be excluded.
Would it be possible to either:
- Allow an exclusion of those specific files mentioned in the error message?
- Set a boolean flag to automatically ignore the chunks that have missing files and not minimize them?
Please let me know!
Allow an exclusion of those specific files mentioned in the error message?
Sorry, it is impossible do here
Set a boolean flag to automatically ignore the chunks that have missing files and not minimize them?
We have the exclude option
Failed to minify the code from this file: pdfmake/vfs_fonts":1
It means you module still not considere as external (maybe wrong regexp?)
Please use the issue template and avoid asking question about versions and how we can reproduce it, thank you
Closing due to inactivity. Please test with latest version and feel free to reopen if still regressions. Thanks!