I'm working with web components, (specifically lit-element), and I want to share a common stylesheet across several different components. What I am trying to achieve is to get the url of the compiled CSS file when I import it in my JS-component so that I can add it as an external stylesheet in the markup.
component.js
import styleUrl from 'url-loader!../styles/placeholder.scss';
...
render(){
return html`
<link rel="stylesheet" href="${styleUrl}">
...
`
}
So I want the styleUrl
to be the url to the compiled css.
Currently my webpack config looks something like the following Webpack config
...
{
test: /\.scss$/,
use: [
"style-loader",
"css-loader",
"sass-loader"
]
}