I found a solution that works well for me.
I moved the list of files to be included to an xml file and in that one I can use the non-debug tags:
Code:
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<!--@non-debug@
<Script file="LibStub\LibStub.lua" />
<Include file="CallbackHandler-1.0\CallbackHandler-1.0.xml" />
<Include file="AceAddon-3.0\AceAddon-3.0.xml" />
...
@end-non-debug@-->
</Ui>
That way I do not get the annoying errors during development and in the released version they are included as the packer changes the tags so that the lines are not commented out.