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

dev模式,node_modules中引用less后,umi.css中只包含node_modules下的样式 #1566

Closed
NicoKam opened this issue Dec 1, 2018 · 9 comments

Comments

@NicoKam
Copy link

NicoKam commented Dec 1, 2018

因为刚好有一个组件,是在js中引用了样式
import from "./xxxx.less";

项目开启了antd支持,也写了很多less样式。在没有install该组件的情况下,umi.css是包含了antd和项目的样式(大约有8000多行)。但install之后,umi.css只有100多行了,只有该组件的样式。

使用umi build后生成的umi.css则是正常的。@sorrycc 求帮助

@NicoKam
Copy link
Author

NicoKam commented Dec 2, 2018

哦我说的组件是写在dependencies

@NicoKam
Copy link
Author

NicoKam commented Dec 2, 2018

我写个demo试一下

@NicoKam
Copy link
Author

NicoKam commented Dec 2, 2018

写了个Demo,测试了下,主要原因是dll插件的问题,如果开启了dll就会导致样式被覆盖。可以拿例子试一下,里面的样式是丢失了的
https://github.com/NicoKam/umi-dependencies-test

@mizi-lin
Copy link
Contributor

me too 开启了dll,
component import less 失效

@QSQ1989
Copy link

QSQ1989 commented Dec 27, 2018

我也遇到了,有临时解决措施吗?

@caowenjin2
Copy link

我也遇到了这个问题,除了关闭dll之外有其他办法吗?😂

@sorrycc
Copy link
Member

sorrycc commented Jan 11, 2019

#915 跟进,同一个问题。

@sorrycc sorrycc closed this as completed Jan 11, 2019
@sorrycc
Copy link
Member

sorrycc commented Jan 11, 2019

我也遇到了这个问题,除了关闭dll之外有其他办法吗?😂

可以 exclude 有问题的依赖。

@honghaozhilian
Copy link

关闭dll也不能解决,怎么办

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants