Support bundled/debug and unbundled/production

Close #1230