Open 17biubiu opened 3 years ago
it seems that the sort of css content in file depend on webpack。
if you add
import css from './views/test.less';
before
import HelloWorld from './components/HelloWorld.vue';
you will get
.hello .test-font { color: green; }
at the first
it seems that the sort of css content in file depend on webpack。 if you add
import css from './views/test.less';
beforeimport HelloWorld from './components/HelloWorld.vue';
you will get.hello .test-font { color: green; }
at the first
按照你说的这样,还是不行。不过我用的下面这种可以,但是和之前出入有点大啊,我升级之后需要改动大量的文件。
do not rely on style order to override since mini-css-extract-plugin
should keep order but it's sort function often broken.
https://github.com/webpack-contrib/mini-css-extract-plugin/issues/657
Version
4.5.8
Environment info
Steps to reproduce
1、基于vue-cli创建一个项目。选择less 2、在views下创建一个test.less文件,
然后在Home里引入。如下:
3、helloword.vue里在div.hello下加入一个
启动服务
What is expected?
在之前的vue-cli2版本里输出的样式是
What is actually happening?
vue-cli4版本里输出的是