Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

154
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda