madge icon indicating copy to clipboard operation
madge copied to clipboard

Normal replacement plugin issue

Open vinaygosain opened this issue 3 years ago • 2 comments

I have components imported like

import X from './X.APP_TARGET'; in my project, where APP_TARGET is replaced into mobile or desktop using webpack's normal module replacement plugin during compilation.

Madge is currently not able to add this import to the dependencies list. Is there a way to fix this?

vinaygosain avatar Jun 21 '21 13:06 vinaygosain

Hey!

It feels like a post-webpack run type of situation where you'd need webpack to run to do the replacement. My only hunch without running madge on the webpack output is to supply your webpack config to madge and see if the webpack import resolution in node-filing-cabinet would infer the final import path without the webpack compilation.

mrjoelkemp avatar Jun 23 '21 11:06 mrjoelkemp

@mrjoelkemp , unfortunately its not working that way, there should be some provision for replacing imports path via a call back function or anything else before forming the dependency tree without use of any webpack config

vinaygosain avatar Jul 10 '21 11:07 vinaygosain