You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A lot of existing sass packages are already npm modules for one reason or another and they might have their own main script that does something completely different from the standard.
Specifically, I'm trying to support making true an eyeglass module.
A few options I see:
Try to require("my_npm_module/eyeglass-exports") and fall back to require("my_npm_module") if that doesn't work.
Always require("my_npm_module") but first check for require("my_npm_module").eyeglass so that if the can return an eyeglass function attached to some other object.
Don't support this... they would need to make a new npm module that wraps their other one and conforms to our existing api.
The text was updated successfully, but these errors were encountered:
I think I might prefer an eyeglass / eyeglass-exports property in package.json which we will resolve and read in. Using our resolve function does properly resolve my_npm_module/package.json. This can override a main property for npm modules that intend main to be something else but still want to integrate with eyeglass.
This pattern has been used in other libraries that want to know more about npm modules without necessarily forcing main adoption or alterations.
For true, the change would then be to add an eyeglass / eyeglass-exports property to package.json, along with the corresponding eyeglass-exports.js (which can also include settings & directory info from a common location, because DRY). This also makes sense because package.json is where they will be tagging the item as eyeglass-module anyway.
A lot of existing sass packages are already npm modules for one reason or another and they might have their own main script that does something completely different from the standard.
Specifically, I'm trying to support making true an eyeglass module.
A few options I see:
require("my_npm_module/eyeglass-exports")
and fall back torequire("my_npm_module")
if that doesn't work.require("my_npm_module")
but first check forrequire("my_npm_module").eyeglass
so that if the can return an eyeglass function attached to some other object.The text was updated successfully, but these errors were encountered: