Skip to content

Instantly share code, notes, and snippets.

@dbanksdesign
Created February 14, 2018 06:02
Show Gist options
  • Save dbanksdesign/17f7a5c9b4130907082684a9190d0deb to your computer and use it in GitHub Desktop.
Save dbanksdesign/17f7a5c9b4130907082684a9190d0deb to your computer and use it in GitHub Desktop.
Style Dictionary Demo Watcher
const StyleDictionary = require('style-dictionary');
const watch = require('node-watch');
watch('./', { recursive: true, filter: /^(properties|components)/ }, function(evt, name) {
console.log('Updating the style dictionary');
try {
styleDictionary = StyleDictionary.extend('config.json');
styleDictionary.buildAllPlatforms();
console.log('\n🎉 Style dictionary finished!');
} catch (e) {
console.log(e);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment