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

[Feature]: Asset Module asset/source cannot be used together with dataUrl #8604

Open
Tracked by #8445
GiveMe-A-Name opened this issue Dec 3, 2024 · 2 comments
Open
Tracked by #8445
Labels
feat New feature or request pr welcome

Comments

@GiveMe-A-Name
Copy link
Member

GiveMe-A-Name commented Dec 3, 2024

What problem does this feature solve?

If set rules as asset/source, it would throw a Error: unreachable: unknow module type: asset/source

module.exports = {
  module: {
   rules: [
     {
        test: /\.jpg$/,
        type: "asset/source",
        generator: {
        dataUrl: {
           mimetype: "text/plain"
	}
     }
   ]
  }
};

What does the proposed API of configuration look like?

https://github.com/webpack/webpack/tree/main/test/configCases/contenthash/assets

@GiveMe-A-Name GiveMe-A-Name added feat New feature or request pending triage The issue/PR is currently untouched. labels Dec 3, 2024
@inottn
Copy link
Collaborator

inottn commented Dec 4, 2024

We should already support asset/source, and it is expected that it cannot be used together with dataUrl. Perhaps the error message here could be optimized to make it clearer.

@GiveMe-A-Name
Copy link
Member Author

We should already support asset/source, and it is expected that it cannot be used together with dataUrl. Perhaps the error message here could be optimized to make it clearer.

OK, I will modify it to make more clearer.

@GiveMe-A-Name GiveMe-A-Name changed the title [Feature]: Asset Module support asset/source [Feature]: Asset Module asset/source cannot be used together with dataUrl Dec 4, 2024
@GiveMe-A-Name GiveMe-A-Name reopened this Dec 4, 2024
@chenjiahan chenjiahan removed the pending triage The issue/PR is currently untouched. label Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request pr welcome
Projects
None yet
Development

No branches or pull requests

3 participants