Fixed duplicate resource bug when building bundle file.
Added support for config option to force debug mode.