Skip to content

💡 Automatically pick up resolve.alias in webpack #939

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

Open
fregante opened this issue Feb 9, 2025 · 1 comment
Open

💡 Automatically pick up resolve.alias in webpack #939

fregante opened this issue Feb 9, 2025 · 1 comment
Labels
feature request Feature request

Comments

@fregante
Copy link

fregante commented Feb 9, 2025

Suggest an idea for Knip

I have this configuration in my webpack.config.js:

    alias: {
      // Not needed in this build
      handlebars: false,

      // https://github.com/webpack/webpack/pull/12693#issuecomment-914079083
      filenamify: "filenamify/browser",

      // Silently improve tree-shakeability and AMD-related errors 
      lodash: "lodash-es",

      // Lighter jQuery version
      jquery: "jquery/dist/jquery.slim.min.js",
    },

In which every lodash import is mapped to lodash-es. This doesn't seem to be picked up by knip, which requires either ignoreDependencies or paths: https://knip.dev/reference/configuration#paths

Can this field be automatically picked up instead? Both for local aliases and node_module aliases

@fregante fregante added the feature request Feature request label Feb 9, 2025
@webpro
Copy link
Member

webpro commented Feb 10, 2025

If you (or someone else) could think of a solution, pull requests to add this are welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Feature request
Projects
None yet
Development

No branches or pull requests

2 participants