Closed robsonn closed 11 months ago
Hey @robsonn thank you for the question! Currently there is no way to run Style Dictionary in the browser because it relies on Node things like the file system. There is a fork of Style Dictionary that does work in the browser: https://github.com/divriots/browser-style-dictionary you can install the npm package browser-style-dictionary
This is something we are planning for the next major release of Style Dictionary: allowing it to be run in browser or any JS-based environment.
For clarity, you'll have to follow the directions they provide in their README, which I believe includes running the whole thing through browserify.
@dbanksdesign I hate to be that guy, but is there an ETA on when this next major release will be coming?
Keen to see this natively running in the browser without the "hacks" that these other packages & repos currently have in place.
Looks like someone from the tokens.studio team is putting in hard work to get this in v4:
This is working out of the box now in the browser without any build-tools required (assuming you use a modern evergreen browser of course).
Feel free to test out 4.0.0-prerelease.0
(or later prerelease version, we will be doing prerelease patches frequently, working towards the v4 new major version).
Also, hop into the style-dictionary-v4 channel on our slack, we'd love to hear feedback when testing the v4 prereleases, and will be communicating further changes there.
Big thanks to @jorenbroekema and the rest of the team for this feature 🚀
style-dictionary
Versions: "style-dictionary": "^3.8.0", "vue": "3.2.47", "vite": "4.1.0",
partial code:
error:
browser-style-dictionary
Versions: "browser-style-dictionary": "3.1.1-browser.1", "vue": "3.2.47", "vite": "4.1.0",
partial code:
error: