Fix #603: Generate DummyParents.js in packager

Note that with this change, a given dummy parent might be created
twice, due to the separate packaging of internal dependencies,
external dependencies and the project code. We make a runtime check to
ensure we don't override anything.
Merge pull request #607 from gzm0/generate-dummy-parents

Fix #603: Generate DummyParents.js in packager