Currently whenever a runtime asset gets created it maps to the runtime plugin in the sourcemap instead of the actual runtime asset.
The reason I've opened this issue is to provide some more context and figure out a proper solution for this as it'll require some reworking in the core logic of runtimes and/or asset requests
Example:

Should map to the runtime's generated code.
Maps to the source code of the runtime plugin
I've got 2 ideas on how to fix this:
Allow returning a sourcemap in the runtime plugin or generate one in applyRuntimes, both is currently impossible as AssetRequestInput has no sourcemap value.
Implement some layer of virtual fs and create the files virtually.
Trying to fix the remaining source map bugs
import parcel from 'url:./parcel.webp';
console.log('test');
Current v2 branch
I like the idea of returning a source map from runtimes as part of assetrequestinput. But in most cases the source map should basically be an empty map that's 1:1 with the code, so maybe in the transformer when AssetRequestInput has a code property it could automatically generate an empty map if none is available?
@devongovett the main issue is the actual source content being incorrect so should I inline that source content into the 1:1 map? Not sure what cache size impact of that would be (on second thought we'd need to store this somewhere regardless of what we do)?
Another issue I see with this is that it will need to reference some kind of unique/generated filepath that doesn't actually exist in the sourcemap as we deduplicate source references in the sourcemap library. I assume it'll be fine but could cause issues.
Change the RuntimeAsset type to contain resolveFromDir instead of filePath, then the path could be ${dir}/${md5(code)}.js (md5(code) is also the asset id)?
Yeah that seems reasonable
this issue is still in v1 version~
Most helpful comment
I like the idea of returning a source map from runtimes as part of assetrequestinput. But in most cases the source map should basically be an empty map that's 1:1 with the code, so maybe in the transformer when AssetRequestInput has a code property it could automatically generate an empty map if none is available?