// assign test to the string "import test from 'test'"
var test = `import test from 'test'`
It seems that as soon as you try to have a variable that contains the string to import a module the packer breaks. It's really easy to reproduce: https://rnplay.org/apps/FBm0LQ
The obvious workaround is to have a variable that concatenates the string but does that make sure that there are no other side effects?