I've seen another work around to detect whether or not a file is being byte-compiled in use-package
: (bound-and-true-p byte-compile-current-file)
It seems to work, as illustrated by this example:
(if (bound-and-true-p byte-compile-current-file)
"I'm being byte-compiled!"
"I'm being evaluated :(")))
When I byte compile that and then evaluate
It prints out
I’m being byte-compiled!
Loading /Users/jake.waksbaum/byte-compile-test.el (source)...
I’m being evaluated :(
Loading /Users/jake.waksbaum/byte-compile-test.el (source)...done