-
-
Notifications
You must be signed in to change notification settings - Fork 197
feat: Add support for using only webpackImporter #562
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
feat: Add support for using only webpackImporter #562
Conversation
webpack resolver supports Also let's use exiting variable, i.e. |
57c18f1
to
9a2edd7
Compare
I've modified the code to reuse the variable |
Regarding the issue where built-in resolver doesn't work with webpack/rspack's option rspack.config.ts:
As mentioned earlier, there are scenarios where different style distributions are defined through environment variables, such as platform-a and platform-b. I defined LESS variables for two different platforms:
File: var.platform-b.less
File: var.less
LESS definitions using these variables:
When we want to avoid prefixing every @import "var.less" with ~ (especially since the ~ prefix is now deprecated), using the built-in resolver prevents webpack/rspack's resolve configuration from taking effect. Therefore, we need to add a configuration to enforce using only webpack/rspack's resolver. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #562 +/- ##
==========================================
+ Coverage 92.02% 92.21% +0.19%
==========================================
Files 3 3
Lines 163 167 +4
Branches 41 44 +3
==========================================
+ Hits 150 154 +4
Misses 12 12
Partials 1 1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This PR contains a:
Motivation / Use-Case
When using the
resolve.extensionAlias
property inwebpack
orrspack
, the built-in importer of less-loader would cause this property to become ineffective. Therefore, we've added anonlyWebpackImporter
option to enable this capability.Breaking Changes
No breaking change
Additional Info
No additional info