First of all, you're talking about two different process flows. A distinction is made between development and production environments.
As a developer you are naturally dependent on the development environment. It is advisable to recompile your files at every file change. These don't have to be minified, but everything concerning styling, i.e. SCSS files for example, should be transformed into browser-readable format, i.e. CSS.
Later, as soon as you can say, Yes, now all requirements are met and all bugs are fixed, you start production. This compiles or rather transplies TypeScript or ES6 in JavaScript and SCSS, LESS etc. in CSS. In addition, your files are compressed so that loading times are reduced. Also you've got a repository of files, that can be distributed to a server or other publishing service of your choice.
In this so-called build process you create a public
or dist
(ributed) folder in which all files are stored. Unlike the development environment, where only the files are kept more or less temporarily.
Popular processing libraries are:
Typical processes are:
- Concatinating many files to few or less files
- Compressing and minifying
- Transpiling higher languages down to browser readable code (for instance JS, CSS, HTML, JSON)