Closed bebraw closed 4 years ago
Will this be compatible with webpack 4?
@sapegin I think we'll have to do a check against webpack version and do another code path for this as likely the APIs haven't been backported to 4. I can give it a quick go.
Ah, that's fine too!
Since we're using TypeScript, it looks more complex than that as the newest typings don't support webpack 4 APIs anymore and we would have to find some way to remedy that.
Perhaps the best thing to do is to refactor the package to use webpack 5 and the publish that as a new major version? That would avoid complications.
That wouldn't work, in Styleguidist we need to support several versions of webpack if it's possible.
We could disable type checking for the webpack 4 branch. It's a hack but what we're doing here is a hack ;-)
Yeah, I see. There's a potential solution. If we maintain webpack 4/5 versions side by side and resolve at package index.js
, that could work while having specific types. It takes a bit of thinking on the TS config but likely it's doable.
Are changes that big to actually worry about it? ;-)
The API changes in webpack 5 are massive and it seems to have a big impact on the code although there fortunately isn't a lot of it.
Then splitting into separate files might be a good idea!
I've made a bit more progress - it looks like we might get away with a @tsignore
.
It looks like we're getting the following warning against webpack 5:
Here's a related comment: https://github.com/webpack/webpack/issues/11425#issuecomment-686606318 .