Patriksandgren's avatar

app.js smaller on production server

I have many vue components in my project and all components contains templates with quite alot of HTML. I am worried that my app.js file is getting to big. But something is strange with it:

When I compile with "npm run prod" my app.js file is 1.28 MiB. When I hard-refresh chrome my website on my developing station networks tab says app.js is 1.3 MiB.

But when I upload the file to my production server (AWS with Forge) and hard refresh the site chrome says app.js is only 351 kB. How can this be? Should I be worried about the size of all my components?

0 likes
2 replies
bugsysha's avatar

If everything works then no. Many reasons can produce smaller size files.

First of all compression which you probably have turned on on production server while it is not on development environment.

When you run npm run prod file gets minified so it also contributes to smaller size.

And so on...

willvincent's avatar

But when I upload the file to my production server (AWS with Forge) and hard refresh the site chrome says app.js is only 351 kB. How can this be?

By default, local development builds don't minify but production builds do.

Please or to participate in this conversation.