0

Id like to:

npm install some-css-component

And then from the corresponding angular 2 component:

@Component({
    selector: 'some-component',
    styleUrls: [ 'some-css-component, ...' ]
})

Is there a way to configure the angular build to resolve the npm some-css-component?

Heretic Monkey
  • 11,687
  • 7
  • 53
  • 122
Ole
  • 41,793
  • 59
  • 191
  • 359
  • `styleUrls` has to point to the relative location of the `css`. you'll have to figure the relative path from your `ts` file to the `node_modules/some-css-component/path/to/file.css` – Ahmed Musallam Apr 27 '17 at 18:53

1 Answers1

1

You can use CSS imports like in global styles:

@Component({
    selector: 'some-component',
    styles: [
        '@import "/node_modules/some-css-component/dist/css/styles.css"'
    ],
})
karser
  • 1,625
  • 2
  • 20
  • 24