Financial-Times/n-makefile

Compiled bundle sizes

Closed this issue · 2 comments

Simply checking our compiled bundle sizes against our target size. Perhaps should fail the branch build.

check-filesize:

ifeq ($(shell [ $(shell stat -f%z public/main.js) -gt 580000 ] && echo false || echo true),false)
    echo "that's way chubby, mate."
    exit 1
endif

Use case: a near 2mb dependency of a dependency got bundled into a production app last week due to a lack of oversight/visibility.

This may be tricky if/when we start multibundling.

let me think about this for a bit, i have a couple of ideas…

darren has implemented a dashboard for this