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
[webpack]: use path.resolve instead of require #14848
Conversation
because this assumes we must always use CJS
Codecov ReportBase: 59.76% // Head: 59.76% // No change to project coverage 👍
Additional details and impacted files@@ Coverage Diff @@
## main #14848 +/- ##
=======================================
Coverage 59.76% 59.76%
=======================================
Files 1339 1339
Lines 32669 32669
Branches 6189 6189
=======================================
Hits 19526 19526
Misses 11296 11296
Partials 1847 1847
Flags with carried forward coverage won't be shown. Click here to find out more. Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
@alexandrebodin I've opted to use More confident in this solution going forward as well because it's extremely close to our current implementation. |
Interesting it looks like it's doing something like we do in the backend here packages/core/strapi/lib/load/package-path.js. Could we use that method ? |
Thanks for letting me know, yes I think that function will work nicely for our needs! |
@Convly I believe this is ready for an experimental release. Do you want to leave this PR, add |
If you can update this branch with main and add a "do not merge" label, we can release an experimental from this branch 🙂 |
A new experimental release has been deployed for To create a new application, use the following command npx create-strapi-app@0.0.0-b4eaa97842f53ed5611c878ecef9654b7bde1c11 my-app --quickstart |
@gu-stav can you review this please? I think we can merge it now 👍🏼 |
What does it do?
Replaces usage of
require.resolve
withpath.resolve
in the admin webpack alias-ing config part.Why is it needed?
Because
require.resolve
demands theCJS
version of a library therefore not allowing the ESM to be used in bundling (which is typically better treeshaked)How to test it?
I'd like this to be released as a
beta
on wednesday so we can discuss with some members of the community to solve their issuesRelated issue(s)/PR(s)