Minification or compression means removing all unnecessary characters, such as spaces, new lines, comments without changing the functionality of the source code. During development and debugging, these characters make code easier to read. At the production stage they only increase the size of code to be transferred.
Before you start
Installing a minification tool
Compressing the code
To compress your code automatically, you need to configure the minification tool as a PyCharm File Watcher.
To create a File Watcher
In the Settings/Preferences dialog Ctrl+Alt+S, go to .
On the File Watchers page that opens, click and select the relevant File Watcher template from the list.
In the New Watcher dialog that opens, specify the path to the relevant executable file or jar archive in the Program field:
compiler.jarfor Closure Compiler.
Optionally, customize the behaviour of the File Watcher.
Make sure the checkbox next to the File Watcher is selected, which indicates that the File Watcher is enabled.
Running a compressor