Skip to content
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

lessLoader实现全局变量注入遇到的问题 #1770

Closed
lh-js opened this issue Jul 11, 2023 · 1 comment
Closed

lessLoader实现全局变量注入遇到的问题 #1770

lh-js opened this issue Jul 11, 2023 · 1 comment
Labels
question Further information is requested

Comments

@lh-js
Copy link

lh-js commented Jul 11, 2023

Question

lessLoader实现全局变量注入,这个lessLoader应该怎么配置,官方文档上也没有说的很清楚

Sample Code

image

@lh-js lh-js added the question Further information is requested label Jul 11, 2023
@PeachScript
Copy link
Member

直接配传给 less-loader 的 options 参数值,也就是上图红框部分

另外需要说明下,lessLoader 配置项仅作用于组件库文档构建,不会对组件库源码构建产生影响,所以建议单独在每个 less 文件里引入变量文件确保组件库发布后可以正常工作,且 less 中暂无法使用别名,需要用相对路径引入其他文件,ref:umijs/father#679

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants