webpack icon indicating copy to clipboard operation
webpack copied to clipboard

ESM output: single runtime chunk resolved to wrong path when using subpath entrys

Open ScriptedAlchemy opened this issue 3 years ago • 5 comments

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 image

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:

ScriptedAlchemy avatar Aug 12 '22 22:08 ScriptedAlchemy

@alexander-akait opened a PR https://github.com/webpack/webpack/pull/16153

ScriptedAlchemy avatar Aug 15 '22 23:08 ScriptedAlchemy

@sokra We need your advice here

alexander-akait avatar Oct 06 '22 16:10 alexander-akait

That seem to be caused by the leading / in the entry name

sokra avatar Nov 09 '22 09:11 sokra

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.

webpack-bot avatar Feb 09 '23 03:02 webpack-bot

Issue was closed because of inactivity.

If you think this is still a valid issue, please file a new issue with additional information.

webpack-bot avatar Feb 24 '23 06:02 webpack-bot