Closed niksy closed 6 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.
Are there any plans for doing it? Maybe contribute to inject-css
like mentioned in referenced issue?
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.
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 likecssify/lib/browser
or by settingbrowser
field inpackage.json
and just usingcssify
? This way, we can easily use combination ofrequire
andexternal
to have only one instance of style injector.