style-dictionary-esm
TypeScript icon, indicating that this package has built-in type declarations

1.3.7 • Public • Published

🪶 style-dictionary-esm

NPM version

An ESM-ready version of Style Dictionary.

  • Fully ESM-ready
  • Allows mocking fs dependency, improving browser support
  • Replaces console.log by consola, with custom levels
  • Replaces node-sass by dart-sass
  • 100% coverage from upstream test suite
  • Drops lodash dependency
  • PNPM, tsup, Vite and Vitest for the repository

Install

npm i style-dictionary-esm

Why

I love Design Tokens and the Style Dictionary API!

Migrating to ESM is a tedious task, but I need it to integrate it inside my projects and toolchains.

I would happily move this work as a PR on the original repo, if this work makes sense in the original project roadmap!

This is an initial step in doing a Vite plugin for Style Dictionary.

Todos

  • Improve tree-shaking
    • Moving formats per-file and require none by default
    • Avoid relying on global export
  • Avoid relying on fs globally, but instead support unified storage layer
  • Make tests paralellizable, currently threads has to be set to false due to fs mismatchs

License

Apache 2.0

Install

npm i style-dictionary-esm

DownloadsWeekly Downloads

2,720

Version

1.3.7

License

Apache-2.0

Unpacked Size

349 kB

Total Files

50

Last publish

Collaborators

  • tahul