         results)
     (unless lite-p
       (dolist (path (doom--module-paths))
-        (nconc targets (nreverse (directory-files-recursively path "\\.el$")))))
-    (when recompile-p
-      (setq targets (cl-remove-if-not (lambda (file) (file-exists-p (concat (file-name-sans-extension file) ".elc")))
-                                      targets)))
+        (nconc targets (append (reverse (directory-files path t "\\.el$" t))
+                               (reverse (file-expand-wildcards (expand-file-name "*/*.el" path)))))))
     (dolist (file targets)
       (push (cons (file-relative-name file doom-emacs-dir)
-                  (byte-recompile-file file nil (unless recompile-p 0)))
+                  (byte-recompile-file file t 0))
             results))
     (let* ((n-fail (cl-count-if (lambda (x) (null (cdr x))) results))
            (n-nocompile (cl-count-if (lambda (x) (eq (cdr x) 'no-byte-compile)) results))

        (message "\n"))
      (when (> n-fail 0)
        (message "\n%s" (mapconcat (lambda (file) (concat "+ ERROR: " (car file)))
                                   (cl-remove-if 'cdr (reverse results)) "\n")))
      (message "%s %s file(s)"
               (if recompile-p "Recompiled" "Compiled")
               (format (if (= total 0) "%s" "%s/%s") total-success total)))))

(defun doom/compile-lite (&optional recompile-p)
  "A light-weight version of `doom/compile' which only compiles core files in
your emacs configuration (init.el and core/**/*.el)."
  (interactive)
  (doom/compile recompile-p t))

(defun doom/clean-cache ()
  "Clear local cache (`doom-cache-dir'). You may need to restart Emacs for some

`doom/packages-autoremove'. "
  (interactive)
  (if noninteractive
      (ignore-errors
        (require 'server)
        (server-eval-at "server" '(let (noninteractive) (doom/reload))))
    (doom-initialize t)
    (doom/compile t)
    (message "Reloaded %d packages" (length doom--package-load-path))))
