davidguttman / cssify

Simple middleware for Browserify to add css styles to the browser.
122 stars 19 forks source link

Reference browser exports by another name #47

Closed niksy closed 6 years ago

niksy commented 8 years ago

Any chance of referencing browser exports by its name?

Currently, it is referenced as full path (require("./node_modules/cssify");) but can it be referenced like cssify/lib/browser or by setting browser field in package.json and just using cssify? This way, we can easily use combination of require and external to have only one instance of style injector.

faergeek commented 8 years ago

In our case referencing module by path instead of just module name is mainly useful for tests. Probably would be better to move browser.js into a separate module like suggested here https://github.com/davidguttman/cssify/pull/45#issuecomment-167903334 And then it will be possible to require it like require('inject-style'); or something like that.

niksy commented 8 years ago

Are there any plans for doing it? Maybe contribute to inject-css like mentioned in referenced issue?

faergeek commented 8 years ago

I'm not sure that contributing to inject-css is possible at all, it's not actively maintained. I plan to split this package into two.