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
This is only true for the CommonJS entrypoint of this library, for ESM (modern way, which I recommend), the import is correct.
Perhaps it makes sense to not use default exports in combination with named exports, since this only works in ESM and not in CJS, meaning you get a slightly different API for CJS because it requires the .default prop. There's other issues with default exports as well that I was recently made aware of, imo making it an anti-pattern.
I'll do a breaking update on this lib that will straighten things out:
As for your README suggestion, both ways work, either by registerFormat or in the format prop in the config, I just prefer doing everything in the config. I'll clarify it in the readme because I do think registerFormat is the one people are more acquainted with.
Hello!
I tried importing the code in this way:
const styleDictionaryToFigma = require('@divriots/style-dictionary-to-figma');
But, found that it doesn't work. Needed to add
.default
.const styleDictionaryToFigma = require('@divriots/style-dictionary-to-figma').default;
Also may I suggest you change the README to use the
registerTransform
method on StyleDictionary:Thanks!
The text was updated successfully, but these errors were encountered: