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

In the monorepo, How are webpack aliases properly addressed #16

Closed
zhongmeizhi opened this issue Oct 18, 2022 · 4 comments
Closed

In the monorepo, How are webpack aliases properly addressed #16

zhongmeizhi opened this issue Oct 18, 2022 · 4 comments
Labels
question Further information is requested

Comments

@zhongmeizhi
Copy link

zhongmeizhi commented Oct 18, 2022

example:

common
  |-- index.js
src
  |-- monoA
     |-- entry.js
  |-- monoB
     |-- entry.js

and npm run monoA, webpack alias "@": 'dir/monoA'
and npm run monoB, webpack alias "@": 'dir/monoB'

then: How are aliases properly addressed

@zhongmeizhi zhongmeizhi changed the title In the mono project, How are webpack aliases properly addressed In the monorepo, How are webpack aliases properly addressed Oct 18, 2022
@webpro webpro added enhancement question Further information is requested labels Oct 19, 2022
@webpro
Copy link
Owner

webpro commented Oct 19, 2022

Just to be sure: you mean resolve.alias from https://webpack.js.org/configuration/resolve/#resolvealias?

Unfortunately Webpack aliases are not addressed at all with Knip. Do you know of a tool to find unused things that does support Webpack aliases?

That said, without knowing the complexity of it all, at first sight it looks similar to TypeScript paths configuration, so it might be doable to add (Webpack plugins are also on my mind for #7).

Let's keep this ticket open. Not highest priority, though. Do you have a repository I could see and explore things?

@brizer
Copy link

brizer commented Dec 29, 2022

Is it supported? Many project has alias such as @ . So it is very necessary.

@webpro
Copy link
Owner

webpro commented Dec 30, 2022

I'm planning on supporting this in v1.1. At this time I'm working towards a v1.0 which is in a beta phase.

It will also be very helpful if you have examples/repositories available.

@webpro
Copy link
Owner

webpro commented Jan 17, 2023

The feature to add paths has been added in v1.6.0. Also see the docs at https://github.com/webpro/knip#paths.

@webpro webpro closed this as completed Mar 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants