Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Works with webpack 'virtual modules' #555

Closed
ntucker opened this issue Jan 12, 2022 · 2 comments · Fixed by #593
Closed

Works with webpack 'virtual modules' #555

ntucker opened this issue Jan 12, 2022 · 2 comments · Fixed by #593

Comments

@ntucker
Copy link

ntucker commented Jan 12, 2022

Motivation: callstack/linaria#879

According to https://webpack.js.org/api/loaders/#inline-matchresource this is the 'official way' to support css in js.

Looking at https://github.com/pmmmwh/react-refresh-webpack-plugin/blob/main/lib/utils/injectRefreshLoader.js however, match(moduleData.resource) is matching the virtual css files because resource shows up as .js, .tsx, or whatever the js file was that had the css embedded.

@ntucker
Copy link
Author

ntucker commented Feb 7, 2022

match(moduleData.matchResource || moduleData.resource) might just do the trick here

@pmmmwh
Copy link
Owner

pmmmwh commented Feb 15, 2022

Will fix this shortly - local tests seem promising

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants