Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Should apply module.generator.outputPath #8539

Open
Tracked by #8445
GiveMe-A-Name opened this issue Nov 26, 2024 · 0 comments · May be fixed by #8554
Open
Tracked by #8445

[Bug]: Should apply module.generator.outputPath #8539

GiveMe-A-Name opened this issue Nov 26, 2024 · 0 comments · May be fixed by #8554
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.

Comments

@GiveMe-A-Name
Copy link
Member

System Info

System:
OS: macOS 13.6.5
CPU: (10) arm64 Apple M1 Pro
Memory: 832.67 MB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
npm: 9.8.1 - ~/Library/Application Support/fnm/node-versions/v18.18.2/installation/bin/npm
pnpm: 9.14.1 - ~/Library/Application Support/fnm/node-versions/v18.18.2/installation/bin/pnpm
bun: 1.0.21 - ~/.bun/bin/bun
Browsers:
Chrome: 131.0.6778.86
Safari: 16.6

Details

The config like bellow code:

/** @type {import("../../../../").Configuration} */
module.exports = {
	mode: "development",
	output: {
		assetModuleFilename: "file[ext]"
	},
	module: {
		rules: [
			{
				test: /\.png$/,
				type: "asset/resource",
				generator: {
					publicPath: "https://cdn/assets/",
					outputPath: "cdn-assets/"
				}
			}
		]
	},
	target: 'node',
	entry: '.'
};

But Rspack is not apply module.generator.outputPath when asset generate.

The image was generated to dist/file.png

Reproduce link

https://github.com/web-infra-dev/rspack/tree/main/tests/webpack-test/configCases/asset-modules/rule-generator-outputPath

Reproduce Steps

  1. pnpm install
  2. ./x build
  3. cd tests/webpack-test/configCases/asset-modules/rule-generator-outputPath
  4. npx rspack

Expected: file.png was generated to dist/cdn-assets/file.png
Received: file.png was generated to dist/file.png

@GiveMe-A-Name GiveMe-A-Name added bug Something isn't working pending triage The issue/PR is currently untouched. labels Nov 26, 2024
@inottn inottn linked a pull request Nov 28, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending triage The issue/PR is currently untouched.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant