focalboard icon indicating copy to clipboard operation
focalboard copied to clipboard

Tech Debt: reduce plugin (Webpack) bundle size by deduplicating `static/` files

Open Pinjasaur opened this issue 1 year ago • 0 comments

Summary

If you view the static directory inside of the Webpack bundle directory, notice that asset files exist twice e.g. file.ext and file..ext.

Viewed from the root focalboard directory:

image image

The problem likely exists in our Webpack configs. Points of interest:

https://github.com/mattermost/focalboard/blob/31569c655a128a36bb495f3a05e5971122f12259/webapp/webpack.common.js#L69-L75

https://github.com/mattermost/focalboard/blob/31569c655a128a36bb495f3a05e5971122f12259/webapp/webpack.common.js#L87-L91

https://github.com/mattermost/focalboard/blob/31569c655a128a36bb495f3a05e5971122f12259/mattermost-plugin/webapp/webpack.config.js#L114-L120

Additional context

The "original" file with out the double .. appears to be processed/compressed i.e.

$ ls -alh mattermost-plugin/dist/focalboard/pack/static/addDescription*
-rw-r--r--  1 paul  staff    62K Aug 30 14:42 mattermost-plugin/dist/focalboard/pack/static/addDescription..png
-rw-r--r--  1 paul  staff    25K Aug 30 14:42 mattermost-plugin/dist/focalboard/pack/static/addDescription.png

Pinjasaur avatar Aug 30 '22 20:08 Pinjasaur