How to reduce my javascript google chrome extension files

I finished developing google chrome extensions. Now it's time to deploy to the Google Chrome Chrome toolbar. But the problem is how to reduce my javascript files (background.js and content.js). I can use the available online tools, but they make one file at a time and do not take into account the dependency on another javascript file.

For example, the transfer of messages between background.js and content.js is done using a key value that tells the other party that it is a message. I'm not sure chrome itself reduces my javascript file. I'm a little illiterate here. Please, help.

+5
source share
1 answer

Chrome does not make any changes out of the box. The Chrome extension will load JavaScript / CSS files, since this minimization is completely up to you. Most extensions remain indispensable to facilitate debugging and for other users to be able to verify the code. For extensions there should be a slight increase in performance.

If you want to minimize , you can run uglify tasks with grunt or gulp .

+9
source

Source: https://habr.com/ru/post/1214453/


All Articles