Closed wespickett closed 11 months ago
@milesj could you take a look at this PR? This is to fix an issue that is causing build failures
@wespickett Think you could add some tests? A bit hard to understand what's going on.
@milesj Added a test. You can try that test on master and it will fail and you will see the issue there. Had to make a small change to the plugin to have something to assert
Thanks, just need to fix the 1 test failure
@milesj Seems like an unrelated failure:
Also can't seem to reproduce it locally:
Are you able to re-run failed jobs? I don't seem to have that option
Yup was flaky. Godd stuff!
There's an issue caused by this line: https://github.com/milesj/packemon/blob/master/packages/packemon/src/rollup/plugins/copyAndRefAssets.ts#L87
chunk.facadeModuleId is not ideal because the bundled code gets moved up to the root (output) directory compared to where it was located in the source files, the imports in the source files that get bundled get changed to be relative to the new bundle location, but the chunk.facadeModuleId is the old location of the index. So, you have the old path + the new updated imports and there could be overlap due to this "hoisting", which has a workaround in determineNewAsset
There doesn't seem to be a better path to use, so this is a workaround that should hopefully fix this issue. Maybe there is a better way to solve this?