使用webpack打包angular2的css会发生冲突
angular2将样式用字符串的形式写在styles不会影响其他的样式,但是通过CSS文件引入的方式就会影响其他的样式。我试过将CSS 转化为字符串,样式不会互相影响特,但CSS 里面的图片webpack 不打包了
home中的class会覆盖live中的同名class
但是将样式写在home的styles中却不会冲突
home/
home.component.ts
index.html
home.css
--------------------------------------------
home.component.ts
@Component({
selector: 'home',
styleUrls: [
'./home.css',
],
templateUrl: 'home.component.html',
})
-live/
live.component.ts
index.html
live.css
--------------------------------
live.component.ts
@Component({
selector: 'live',
styleUrls: [
'./live.css',
],
templateUrl: './index.html',
})