There are two functions that can be used here:
System.normalizeSync and System.decanonicalize.
System.normalizeSync does the standard normalization, including the main (pkg -> path/to/npm/p...@1.2.3/main.js), while System.decanonicalize will just apply paths and baseURL configs and not map config (pkg -> baseURL/pkg, npm:p...@1.2.3 -> path/to/npm/p...@1.2.3).
The annoying thing here is neither does what you want, so previously I added an exception where `System.normalizeSync('pkg/')` with a trailing slash will not apply the main (pkg/ -> path/to/npm/p...@1.2.3/)
But there was an issue with this approach in that normalize('../', 'path/to/npm/p...@1.2.3/dir/x.js') effectively resolves to a folder, which should apply the main, so it was a normalization inconsistency and this case needed to be removed.
Unfortunately that means you need to actually do `System.normalizeSync('pkg//')` currently to get `path/to/npm/p...@1.2.3//' in order to achieve what you're trying to achieve.
Ideally we can work out the normalization algorithm to be able to distinguish between `normalize('pkg/')` not doing mains, and `normalize('../', 'path/to/n...@1.2.3/pkg/x/y.js')` doing the main addition, but I haven't yet worked out how to do this consistently in the normalization process.