This task encompasses the work to enable the tree-shaking boogie-woogie necessary for Webpack to eliminate dead code:
- Use imports and exports everywhere. require and module.exports do support this hip new dance.
- Minimize side-effects in modules. For example, modules.js modifies the global mw object, mw.mobileFrontend, which is considered an impure side-effect.
- Identify modules with side-effects in package.json. E.g.:
..., "sideEffects": [ "src/mobile.startup/modules.js" ], ...
It would be useful to actually report dead functions and files so they can be removed from the codebase. Maybe these untested plugins can help?