Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

159
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!