-
Notifications
You must be signed in to change notification settings - Fork 54
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
Inject styles into head tag like style-loader #29
Comments
I am sorry but this plugin cannot generate the From what I know, This plugin is intended for server side rendering. Only way how to make something like you want possible is to create a plugin that appends a runtime to javascript that will work similar to Try to look on:
But I think glamor is what you want. It is used by styled-components if I am not mistaken. |
@michalkvasnicak Thank you so much for the explanation and advice! Like I said, I'm still pretty new to developing packages to be used by other projects. I guess because I am transpiling everything with babel in my |
@andynoelker No problem :). You can still provide your css files in package. But you need to configure webpack so it can parse your We are doing something like that at work. We have |
@michalkvasnicak This is all for my work so we also have the luxury of enforcing our consumer apps to parse this project with webpack in |
@andynoelker you could use webpack to do what you want. You just need to import your module so webpack will know that it has to transpile source code of your module.
I am using webpack for server side and client side. Where on the server side I am just getting class names and on the client side I am extracting styles to css file in production. Style loader is used only during the development process. For example here are webpack 2 configurations for server side and client side in my utility that I use to quickly bootstrap project. (sorry for self-promo). But it is excluding |
I apologize if this is not the correct repository to post into. I have been using css modules with style-loader in a project for some time, and it builds a
<style>
block in my<head>
tags (instead of bundling everything into an external file using extract-text-webpack-plugin). I am trying to turn my project into a private library that I can install in my other projects from a private git server. Doing so led me here. When I use this project I can see that it successfully generates the hashed class names for my elements. However, I lose the generated<style>
block in my document so the class names are virtually meaningless.I am new to package development so maybe I am going about this the wrong way, but is there a way for this project to emulate the behavior of style-loader and add the hashed css files inside of a
<style>
tag on the page? I am currently not using any config options with this project, just adding"plugins": ["css-modules-transform"]
to my.babelrc
. Any pointers at all would be helpful. Thank you!The text was updated successfully, but these errors were encountered: