ESM output: single runtime chunk resolved to wrong path when using subpath entrys
Bug report
What is the current behavior?
If i create entrypoints that include a path in their name, when runtimeChunk: single is set - webpack imports the runtime from the wrong directory.
If the current behavior is a bug, please provide the steps to reproduce.
using this config:
module.exports = {
output: {
module: true
},
target: ['es2022','async-node'],
mode: "development",
entry: {
'/test/one': './counter',
'/test/two': './example'
},
optimization: {
usedExports: true,
concatenateModules: true,
runtimeChunk: 'single'
},
experiments: {
outputModule: true
}
};
Emits the following

the runtime.js file is getting imported from ../../ instead of ../
What is the expected behavior?
runtime chunk should resolve it correct location
Other relevant information: webpack version: 5.74.0 Node.js version: 16 Operating System: OSX Additional tools:
@alexander-akait opened a PR https://github.com/webpack/webpack/pull/16153
@sokra We need your advice here
That seem to be caused by the leading / in the entry name
This issue had no activity for at least three months.
It's subject to automatic issue closing if there is no activity in the next 15 days.
Issue was closed because of inactivity.
If you think this is still a valid issue, please file a new issue with additional information.