-
Notifications
You must be signed in to change notification settings - Fork 569
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BREAKING: make style-dictionary ESM-only and browser-compatible
- Loading branch information
1 parent
c5a9592
commit 94b69ed
Showing
99 changed files
with
3,368 additions
and
13,074 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,27 @@ | ||
const StyleDictionary = require('style-dictionary').extend(__dirname + '/config.json'); | ||
const fs = require('fs'); | ||
const _ = require('lodash'); | ||
import StyleDictionary from 'style-dictionary'; | ||
import { dirname } from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
import fs from 'fs'; | ||
import _ from 'lodash'; | ||
|
||
const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
const sd = await StyleDictionary.extend(__dirname + '/config.json'); | ||
|
||
console.log('Build started...'); | ||
console.log('\n=============================================='); | ||
|
||
StyleDictionary.registerFormat({ | ||
sd.registerFormat({ | ||
name: 'custom/format/scss', | ||
formatter: _.template(fs.readFileSync(__dirname + '/templates/web-scss.template')), | ||
}); | ||
|
||
StyleDictionary.registerFormat({ | ||
sd.registerFormat({ | ||
name: 'custom/format/ios-plist', | ||
formatter: _.template(fs.readFileSync(__dirname + '/templates/ios-plist.template')), | ||
}); | ||
|
||
// FINALLY, BUILD ALL THE PLATFORMS | ||
StyleDictionary.buildAllPlatforms(); | ||
sd.buildAllPlatforms(); | ||
|
||
console.log('\n=============================================='); | ||
console.log('\nBuild completed!'); |
Oops, something went wrong.