Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

158
Vistas
Is there a way to overwrite some data from the extended json config file in StyleDictionary?

Question is simple:

I've a javascript file

const StyleDictionary = require('style-dictionary').extend('color-config.json');

and a json config file

{
  "source": ["tokens/color.json"],
  "platforms": {
    "css": {
      "transforms": ["color/css"],

Since I'm using a particular architecture, I need to prefix the source of all token config jsons with a pre path, so currently the situation is the following in my build process the source tokens/color.json is not working, instead I need to use for instance something like this /extra/architecture/private/tokens/color.json. But I would like not to append this pre path in the json directly, I would like to be able to add it maybe via javascript through one single config parameter.

At the moment I couldn't find a good way to do it, only good approach is to edit directly the config json file.

Any better ideas?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Here is the answer, extend can be reworked multiple times, and returns the new updated object handler of Style Dictionary.

const StyleDictionary = require('style-dictionary').extend('color-config.json');

StyleDictionary.extend({
  source: StyleDictionary?.options?.source
    ? StyleDictionary.options.source.map(
        source => `extra/architecture/private/${source}`
      )
    : [],
  platforms: StyleDictionary.options.platforms,
}).buildAllPlatforms();
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda