-
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Failed to build when webpack alias for asset is an array of paths instead of a single path #10
Comments
Thanks for adding it to the "in development" milestone. :) I hope I will not have to wait for long as I'm slightly blocked, but not too worry too much :) |
fix optional prefix of alias in request when an alias name self contains the prefix
hallo @Rush thank you for very important issue. I have enhanced the resolving of alias for array. You can see possible usage cases in the fixture and resolve.alias for
This is limitation of webpack compiler self, webpack don't recognize an asset request contained a variable. But the webpack resolver resolve this assets correct. This limitation does not affect the New version is |
fix optional prefix of alias in request when an alias name self contains the prefix
Awesome! THe workaround for not using variables in the require expression is simply to prepare utility data structures. Such as: - const statusIcons = { draft: require('images/status/draft.png'), reject: require('images/status/reject.png'), review: require('images/status/review.png'), approve: require('images/status/review.png') }; |
Thanks, it works too :-) |
fix optional prefix of alias in request when an alias name self contains the prefix
Fixed, works great now. Thank you! |
See my full repro here: https://github.com/Rush/webdiscus-repro and run
npm run reproduce
.Or to reproduce by hand, setup the resolve alias as a list of paths, instead of a single path
and then require the asset from
pug
Requiring same asset from JS/TS works fine via:
The text was updated successfully, but these errors were encountered: