The importmap path is incorrect when .js is a substring of the module path.
Reproduction
Add to config/importmap.rb:
pin_all_from 'app/javascript/test', under: 'test'
Add to app/javascript/application.js:
Create file app/javascript/test/foo.jszip.js with content:
export function asdf() { return 3; }
Run:
$ RAILS_ENV=production bin/rails assets:clobber
$ RAILS_ENV=production bin/rails assets:precompile --trace
Test:
$ RAILS_ENV=production bin/importmap json|grep foo
"test/foozip": "/assets/test/foo.jszip-2be366e5912d407e15016b08dd7eedbdf5b28865f4d003766b4c47052cab606c.js"
Problem
The "test/foozip" path is incorrect.
It is expected to be "test/foo.jszip".
It appears there is code somewhere that is removing .js from the middle of the path rather than just the end.