{"action":"created","issue":{"url":"https://api.github.com/repos/michalkvasnicak/babel-plugin-css-modules-transform/issues/29","repository_url":"https://api.github.com/repos/michalkvasnicak/babel-plugin-css-modules-transform","labels_url":"https://api.github.com/repos/michalkvasnicak/babel-plugin-css-modules-transform/issues/29/labels{/name}","comments_url":"https://api.github.com/repos/michalkvasnicak/babel-plugin-css-modules-transform/issues/29/comments","events_url":"https://api.github.com/repos/michalkvasnicak/babel-plugin-css-modules-transform/issues/29/events","html_url":"https://github.com/michalkvasnicak/babel-plugin-css-modules-transform/issues/29","id":197406846,"number":29,"title":"Inject styles into head tag like style-loader","user":{"login":"andynoelker","id":4426398,"avatar_url":"https://avatars.githubusercontent.com/u/4426398?v=3","gravatar_id":"","url":"https://api.github.com/users/andynoelker","html_url":"https://github.com/andynoelker","followers_url":"https://api.github.com/users/andynoelker/followers","following_url":"https://api.github.com/users/andynoelker/following{/other_user}","gists_url":"https://api.github.com/users/andynoelker/gists{/gist_id}","starred_url":"https://api.github.com/users/andynoelker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andynoelker/subscriptions","organizations_url":"https://api.github.com/users/andynoelker/orgs","repos_url":"https://api.github.com/users/andynoelker/repos","events_url":"https://api.github.com/users/andynoelker/events{/privacy}","received_events_url":"https://api.github.com/users/andynoelker/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-23T17:49:44Z","updated_at":"2016-12-24T15:13:31Z","closed_at":null,"body":"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.\r\n\r\nI 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!"},"comment":{"url":"https://api.github.com/repos/michalkvasnicak/babel-plugin-css-modules-transform/issues/comments/269088135","html_url":"https://github.com/michalkvasnicak/babel-plugin-css-modules-transform/issues/29#issuecomment-269088135","issue_url":"https://api.github.com/repos/michalkvasnicak/babel-plugin-css-modules-transform/issues/29","id":269088135,"user":{"login":"michalkvasnicak","id":174716,"avatar_url":"https://avatars.githubusercontent.com/u/174716?v=3","gravatar_id":"","url":"https://api.github.com/users/michalkvasnicak","html_url":"https://github.com/michalkvasnicak","followers_url":"https://api.github.com/users/michalkvasnicak/followers","following_url":"https://api.github.com/users/michalkvasnicak/following{/other_user}","gists_url":"https://api.github.com/users/michalkvasnicak/gists{/gist_id}","starred_url":"https://api.github.com/users/michalkvasnicak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/michalkvasnicak/subscriptions","organizations_url":"https://api.github.com/users/michalkvasnicak/orgs","repos_url":"https://api.github.com/users/michalkvasnicak/repos","events_url":"https://api.github.com/users/michalkvasnicak/events{/privacy}","received_events_url":"https://api.github.com/users/michalkvasnicak/received_events","type":"User","site_admin":false},"created_at":"2016-12-24T15:13:31Z","updated_at":"2016-12-24T15:13:31Z","body":"I am sorry but this plugin cannot generate the `<style>` tags for you because it doesn't know anything about that. It is not working like Webpack which is bundler. What you can do is to generate a css file for your project using this plugin during the build process.\r\n\r\nFrom what I know, `style-loader` is appending the `<style>` tags during in the runtime. So webpack will compile your css to a javascript file and then when you run this file in browser, it will append style tags to html.\r\n\r\nThis 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 `style-loader`. So it will compile your css and appends it to javascript. Maybe there is something like that. \r\n\r\nTry to look on:\r\n\r\n- https://github.com/threepointone/glamor\r\n- https://github.com/smyte/jsxstyle\r\n- https://styled-components.com/\r\n\r\nBut I think glamor is what you want. It is used by styled-components if I am not mistaken."}}
{"actor":{"display_login":"michalkvasnicak"}}