In the module editor, set the folder that will be excluded from the project, i.e. completely ignored. Select a folder and click the "Excluded" button. Then the folder will be shown in red and will not even be displayed in the IDEA project view, and there will be no indexing or compilation in this folder.

source share