does not support import remote css as less in less files
See original GitHub issueVersions
- dumi: 1.1.23
- node: v14.15.4
- npm: 6.14.11
- OS: macOS Big Sur 11.2.3
- Browser: Edge 91.0.864.67
Steps to reproduce
在组件的 less
样式文件里通过 @import
语法引入 web url 地址
@import (less) url('https://at.alicdn.com/t/font_2673961_hg2vb7cj7i.css');
.a {
color: red;
}
What is Expected?
正确加载
What is actually happening?
启动时报错
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (5 by maintainers)
Top Results From Across the Web
import .css file into .less file - Stack Overflow
If you want to import a CSS file, and don't want LESS to process it, just use the .css extension: @import "lib.css"; The...
Read more >Importing remote urls broken with v3.0.1 #3188 - less/less.js
With less v2.7.3 (using webpack v3.1.0 and less-loader v4.1.0) I ... does not support import remote css as less in less files umijs/dumi#775....
Read more >import - CSS: Cascading Style Sheets - MDN Web Docs
The @import CSS at-rule is used to import style rules from other valid stylesheets. An @import rule must be defined at the top...
Read more >Css – import .css file into .less file - iTecNote
All imports are other .less files and all works as it should. My current issue is this: I want to import a .css...
Read more >Style Sheets | IntelliJ IDEA Documentation - JetBrains
With IntelliJ IDEA, you can create new rulesets from existing declarations in CSS, SCSS, Sass, or Less files and even move entire rulesets ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@RunningCoderLee 理解了,Umi 自带的 less-loader 是锁到 5.0 的,背后是 3.x 的 Less.js,你使用的这个功能应该是 Less.js 4.0 出来的,所以要使用这个特性只能覆盖默认的 less-loader
这个不算是用法问题吧,我单纯使用 webpack 的 demo 项目去验证这个场景是没有问题的
发现一个解决方案
在
.umirc.ts
中用chainWebpack
更改 umi 引入的less-loader
是可以解决这个问题的是不是引入的 loader 有问题?
顺带一提,在还没有明确问题根本原因前,能不能先不关闭 issue 并添加无效标签?
@PeachScript