webpack不加载scss文件?

时间:2016-12-14 11:00:07

标签: angular webpack

我在signin文件夹中包含了这4个文件。

signin.component.ts
signin.module.ts
signin.style.scss
signin.template.html

signin.style.scss我声明要导入位于node_modules的两个文件:

@import "../../../node_modules/bootstrap/scss/_variables";
@import "../../../node_modules/bootstrap/scss/mixins";

然而,当我在浏览器上查看已定位资源时出现问题:

我的Signin组件如下:

@Component({
  selector: 'signin',
  styleUrls: [ './signin.style.scss' ],
  templateUrl: './signin.template.html'
})
export class Signin implements OnInit {

然而,signin.style.scss和其他导入("../../../node_modules/bootstrap/scss/_variables""../../../node_modules/bootstrap/scss/mixins")都没有加载到浏览器上。

有什么想法吗?

1 个答案:

答案 0 :(得分:0)

你需要在webpack中使用loader。

df = data.frame(y=c("ABC","A"), z=c("ABC","A,B,C"))

apply(df, 1, function(x) {               # perform rowise ops.
  y = unlist(strsplit(x[1], ","))        # splitting X$y if incase it had ","  
  z = y %in% unlist(strsplit(x[2], ",")) # check how many of 'X$y' present in 'X$z'
  if (sum(z) == length(y))               # if all present then return TRUE
    return(TRUE)
  else
    return(FALSE)
})

# 1] TRUE TRUE

# Case 2: changed the data. You will have to define if you want perfect subset or not. Accordingly we can update the code
df = data.frame(y=c("ABC","A,B,D"), z=c("ABC","A,B,C"))
#[1]  TRUE FALSE