html-webpack-plugin icon indicating copy to clipboard operation
html-webpack-plugin copied to clipboard

fix: avoid importing all of lodash

Open leventdeniz opened this issue 7 months ago • 3 comments

This PR reduces bundle size and makes it more resilient to use in monorepo setups using nx or yarn workspaces.

This specific error is fixed:

TypeError: _.uniq is not a function
    at HtmlWebpackPlugin.getAssetFiles (/app/node_modules/html-webpack-plugin/index.js:738:21)
    at HtmlWebpackPlugin.generateHTML (/app/node_modules/html-webpack-plugin/index.js:1025:46)
    at /app/node_modules/html-webpack-plugin/index.js:174:22
    at fn (/app/node_modules/webpack/lib/Compilation.js:510:9)
    at _next2 (eval at create (/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:16:1)
    at eval (eval at create (/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:39:1)
    at eval (eval at create (/app/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:11:1)
Bildschirmfoto 2024-07-11 um 10 48 16

leventdeniz avatar Jul 11 '24 08:07 leventdeniz