vuejs / vue-style-loader

💅 vue style loader module for webpack

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

【feature request】disable singleton option

hxlniada opened this issue · comments

Do you want to request a feature or report a bug?

In my IE9, style is broken, and I don't know how to debug it, because vue-style-loader force me to use singleton mode, all of my styles is in one style tag.

when I delete these

if (isOldIE) {
    // use singleton mode for IE9.
    var styleIndex = singletonCounter++
    styleElement = singletonElement || (singletonElement = createStyleElement())
    update = applyToSingletonTag.bind(null, styleElement, styleIndex, false)
    remove = applyToSingletonTag.bind(null, styleElement, styleIndex, true)
  } else {
    
  }

it works fine

if vue-style-loader has a singleton option(just like style-loader), It will helps alot, thanks.

Singleton mode is specifically for IE9, I'm not sure if that's the root of the problem unless you can provide a reproduction.

@yyx990803 不是说出现了一个bug,而是提供这么一个选项,使用者可以方便调试,比如我出现的问题是样式完全没有作用,而且样式全在一个style下,也不知道是哪块出问题了,但是去掉singleton那一块,样式就恢复了,如果能提供一个选项禁用singleton,对于调试会很方便

ps: style-loader 就有一个 singleton 选项 https://github.com/webpack-contrib/style-loader#singleton

thanks

english version:
It's not a bug report, option singleton is really helpful for debug
ps: style-loader has a singleton option, link https://github.com/webpack-contrib/style-loader#singleton

尤大,我也不知道我代码问题出在哪,不好复现,你看看要不要加一个选项,这周末我应该有时间,研究下代码提个pr

english: I don't know what's problem here, I will send a pr if I have time this weekend, thank you.

我发现问题在哪了,应该是我的样式表太长了

具体发现过程:我在样式表的第23000行左右的地方加上一个样式
body {
background; #f00;
}
大概在这个地方,超过一行就失效了,在这一行的后面,无论放什么样式,都是失效的
排查了非常久的时间

english:
Finally I find what's wrong in my code, maybe it's because my style code is too long. After about 23000 line's style code in one style tag. All of the style after doesn't work