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]: Create ignoredModule from moduleDependency in normal_module_factory. #8531

Open
Tracked by #8445
GiveMe-A-Name opened this issue Nov 26, 2024 · 0 comments
Labels
feat New feature or request

Comments

@GiveMe-A-Name
Copy link
Member

What problem does this feature solve?

In webpack, moduleDependency has a method createIgnoredModule that responsible for create ignored module in normal_module_factory.

But in Rspack, we only use RawModule to new ignored module.

More detail see: https://github.com/web-infra-dev/rspack/blob/v1.1.3/crates/rspack_core/src/normal_module_factory.rs#L348-L359

It's would cause a asset-modules/ignored test failed, https://github.com/web-infra-dev/rspack/tree/v1.1.3/tests/webpack-test/configCases/asset-modules/ignore

What does the proposed API of configuration look like?

Align webpack, The trait ModuleDependency add create_ignored_module fn.

pub trait ModuleDependency: Dependency {
  ...
  fn create_ignored_module(&self, context: Context) -> BoxDependency {
    // return a default dependency
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feat New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants