从 npm 导入 Angular 2 css?
Importing Angular 2 css from npm?
我想:
npm install some-css-component
然后从对应的angular2个分量:
@Component({
selector: 'some-component',
styleUrls: [ 'some-css-component, ...' ]
})
有没有办法配置 angular 构建来解析 npm some-css-component
?
您可以使用 CSS imports like in global styles:
@Component({
selector: 'some-component',
styles: [
'@import "/node_modules/some-css-component/dist/css/styles.css"'
],
})
我想:
npm install some-css-component
然后从对应的angular2个分量:
@Component({
selector: 'some-component',
styleUrls: [ 'some-css-component, ...' ]
})
有没有办法配置 angular 构建来解析 npm some-css-component
?
您可以使用 CSS imports like in global styles:
@Component({
selector: 'some-component',
styles: [
'@import "/node_modules/some-css-component/dist/css/styles.css"'
],
})