Use defeatureify to enhance brick performance in production mode
Defeatureify is a npm module that can remove instructions from code.
It can be added to the build toolchain to remove instructions in brick that are not relevant in production mode, but still present, and thus bloating the minified code.
With this tool, we could :
- remove
console.log
,console.debug
,console.info
- remove assertions in code, and as they are not present anymore in production, encourage their usage (no one is actually using assertions in bricks at the moment, and it is prejudicial)
As a matter of consequence, it would also justify even more the use of production and development mode for bricks. The developer would thus only see the logs and assertions for the development he's working on.