GoogleChrome / lighthouse-ci

Automate running Lighthouse for every commit, viewing the changes, and preventing regressions
Apache License 2.0
6.33k stars 633 forks source link

The `assets` folder in `node_modules/@lhci/server/dist` disappears after modules are pruned by `node-prune` #969

Open VoloshinS opened 8 months ago

VoloshinS commented 8 months ago

Describe the bug The assets folder in node_modules/@lhci/server/dist disappears after modules are pruned by node-prune.

To Reproduce Steps to reproduce the behavior:

  1. Install @lhci/server into a project.
  2. Run npx node-prune ./node_modules.
  3. Check node_modules/@lhci/server/dist folder.

Expected behavior node_modules/@lhci/server/dist contains assets folder.

Actual behavior node_modules/@lhci/server/dist doesn't contain assets folder.

Additional context It is obviously happening, because there are no direct imports from assets folder, so node-prune considers this folder unnecessary and removes it.

Issue was created rather for anyone who ended up in debugging why fonts and images are not displayed for deployed server. Not sure if many people have in their build process node-prune command, which may cause this unexpected situation. So feel free to close, if you think no actions are needed at the moment.