angular2-template-loader icon indicating copy to clipboard operation
angular2-template-loader copied to clipboard

Add assuring that exported is a string

Open zhakhalov opened this issue 9 years ago • 2 comments

I have met issue caused by using of ExtractTextPlugin with following error message:

Expected 'styleUrls' to be an array of strings.

Idea of my fix is an ensuring that each element of styleUrls is a string. The result (in bundle) looks like:

core_1.Component({
    ...
    styles: [typeof __webpack_require__(296) === 'string' ? __webpack_require__(296) : '']
    ...
})

I would not like to update tests untill your approval of solution. Waiting for your response. Thanks in advance.

zhakhalov avatar Nov 27 '16 21:11 zhakhalov

@zhakhalov This would work very well for my case. I am using style-loader to pull the generated css in outside of the component (so I can do hot reload) and had to work around the fact that what ends up in styles is not a string. Would love it if this was done automatically.

abierbaum avatar Jan 18 '17 23:01 abierbaum

Hey @TheLarkInn Is this PR going to be merged?

zhakhalov avatar Jun 30 '17 11:06 zhakhalov