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]: Support module.id #8741

Open
luhc228 opened this issue Dec 17, 2024 · 1 comment
Open

[Feature]: Support module.id #8741

luhc228 opened this issue Dec 17, 2024 · 1 comment
Assignees
Labels
feat New feature or request

Comments

@luhc228
Copy link
Contributor

luhc228 commented Dec 17, 2024

What problem does this feature solve?

I want to get module.id in webpack plugin like:

compiler.hooks.thisCompilation.tap('plugin-name', (compilation) => {
      compilation.hooks.processAssets.tap('plugin-name', () => {
        const entrypoint = compilation.entrypoints.get(xxx)
        const modules = compilation.chunkGraph.getChunkModules(entrypoint.chunks[0])
        console.log(modules[0].id) // log like `(layer-name)/./your/file/path.js`
     })
})

But Rspack doesn't support get the module.id now.

What does the proposed API of configuration look like?

Return the id in module instance.

@luhc228 luhc228 added feat New feature or request pending triage The issue/PR is currently untouched. labels Dec 17, 2024
@LingyuCoder LingyuCoder self-assigned this Dec 17, 2024
@LingyuCoder LingyuCoder removed the pending triage The issue/PR is currently untouched. label Dec 17, 2024
@SyMind
Copy link
Member

SyMind commented Dec 19, 2024

@luhc228 using chunkGraph.getModuleId(mod).

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

3 participants