Grafana 4 does not serve minified JS files to the browser

While using Grafana 4, I noticed in the Chrome Dev tools that the JS dependency files being served to the browser are non-minified JS files.

I was trying to see if I can improve the performance of the load time and was hoping that setting the app_mode configuration to “production” would serve the minified JS dependencies but it seems it does not. angular,js takes a little over a second to load. I did find that the minified version in the public/vendor/angular directory.

I was wondering if there was a way to get Grafana to serve the minified JS files?

How did you install Grafana? And on which OS?

Most core js files are minified and bundled in on big js file. If you see files loading unminified one at a time you must e running a custom development build

@daniellee Thank you for responding. This is being run on Ubuntu 16.04 in a docker container.

I looked into how we were installing Grafana found that we build the the back-end by doing:

go run build.go setup
go run build.go build

But build the front-end using:

npm run build

At which point I realized that I should’ve been doing a

grunt release

which worked!

Thanks for your help on this! Apologies for my tardiness in responding.

@torkel Thanks for responding. You were right in pointing out that we were running a custom development environment and building this from source.

I fixed the issue by running

grunt release

which provides the necessary files into /public_gen

I did notice that running

go run build.go test

produces a result that does not serve minified JS files. Which just meant I ran the tests first (as should be the case) and then ran the grunt command.

Thank you for your help with this! And I apologize for not replying with my findings sooner.