Description
When building a production bundle with repack, the resulting source map output is invalid. We tracked this down to being caused by the __CHUNKS__ code insertion in https://github.com/callstack/repack/blob/main/packages/repack/src/webpack/plugins/OutputPlugin.ts#L165-L172
When commenting it out, the source maps work again. My guess is that the hook compilation.hooks.afterProcessAssets is too late in the process or maybe that the ConcatSource is not the right way to inject it.
Reproducible Demo
cd packages/TesterApp
yarn react-native webpack-bundle --platform ios --entry-file index.js --bundle-output ./dist/main.jsbundle --dev=false
npx source-map-explorer ./dist/main.jsbundle
Description
When building a production bundle with repack, the resulting source map output is invalid. We tracked this down to being caused by the
__CHUNKS__code insertion in https://github.com/callstack/repack/blob/main/packages/repack/src/webpack/plugins/OutputPlugin.ts#L165-L172When commenting it out, the source maps work again. My guess is that the hook
compilation.hooks.afterProcessAssetsis too late in the process or maybe that theConcatSourceis not the right way to inject it.Reproducible Demo
cd packages/TesterApp yarn react-native webpack-bundle --platform ios --entry-file index.js --bundle-output ./dist/main.jsbundle --dev=false npx source-map-explorer ./dist/main.jsbundle