You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use inline CSS with the plugin, but what i got inside style is the resource url of the SCSS I required.
For example, if I use inline CSS using style=require('./styles.scss?inline'), the content of style will be style.3ef5f.css instead of the CSS code generated by webpack.
After some research, I found that the sourceRequest (index.js#L655) added to AssetSource is different from rawRequest (Resolver.js#L286) used by require.
The sourceRequest's path separator is \, which is Windows style (I'm working on Windows).
The rawRequest's path separator is /.
If I replace all / in rawRequest to \ using debugger, everything is working as expected.
The text was updated successfully, but these errors were encountered:
YUCLing
changed the title
Inline CSS not working due to the difference between sourceRequest and rawRequest
[Windows] Inline CSS not working due to the difference between sourceRequest and rawRequest
Jan 12, 2023
But your inline JS seems to be not working properly. I'm not sure what caused it, I will try to find out when possible and open an new issue if necessary.
The following output is what I got from inline JS.
I'm trying to use inline CSS with the plugin, but what i got inside
style
is the resource url of the SCSS I required.For example, if I use inline CSS using
style=require('./styles.scss?inline')
, the content ofstyle
will bestyle.3ef5f.css
instead of the CSS code generated by webpack.After some research, I found that the
sourceRequest
(index.js#L655) added toAssetSource
is different fromrawRequest
(Resolver.js#L286) used byrequire
.The
sourceRequest
's path separator is\
, which is Windows style (I'm working on Windows).The
rawRequest
's path separator is/
.If I replace all
/
inrawRequest
to\
using debugger, everything is working as expected.The text was updated successfully, but these errors were encountered: