-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathactions.js
41 lines (34 loc) · 1.1 KB
/
actions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
const { execSync } = require('node:child_process')
const path = require('node:path')
const StyleDictionary = require('style-dictionary')
const noop = require('lodash/fp/noop')
StyleDictionary.registerAction({
do: () => {
const constantsPath = path.resolve(__dirname, './constants.js')
const destinationDirectory = 'dist/web/typescript/'
const destinationPath = path.resolve(
__dirname,
`../${destinationDirectory}`,
)
execSync(
`yarn to-esm ${constantsPath} --output ${destinationPath} --extension .js --minify --no-comments --noHeader`,
)
console.log(`✔︎ ${destinationDirectory}constants.js (ESM)`)
},
name: 'typescript/copy-constants',
undo: noop,
})
StyleDictionary.registerAction({
do: () => {
const destinationDirectory = 'dist/web/'
execSync(`yarn run tsc --outDir ${destinationDirectory}`)
console.log(
`✔︎ ${destinationDirectory}tailwindcss/tailwind.config.js (ESM)`,
)
console.log(
`✔︎ ${destinationDirectory}tailwindcss/tailwind.theme.js (ESM)`,
)
},
name: 'tailwindcss/copy-config',
undo: noop,
})