Skip to content

Commit 2f2fd29

Browse files
committed
fix(build): fix build
1 parent b1c7afc commit 2f2fd29

File tree

5 files changed

+132
-126
lines changed

5 files changed

+132
-126
lines changed

playground/nuxt.config.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ const themeDir = fileURLToPath(new URL('./', import.meta.url))
66
const resolveThemeDir = (path: string) => resolve(themeDir, path)
77

88
export default defineNuxtConfig({
9-
typescript: {
10-
shim: false
11-
},
12-
139
alias: {
1410
'@nuxtjs/design-tokens': resolveThemeDir('../src/module.ts')
1511
},

playground/tailwind.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { $dt } from '../src/index'
1+
import { $dt } from '../src'
22

33
export default {
44
theme: {

src/generate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { existsSync } from 'fs'
2-
import { unlink, writeFile } from 'fs/promises'
2+
import { rm, writeFile } from 'fs/promises'
33
import type { Core as Instance } from 'browser-style-dictionary/types/browser'
44
import StyleDictionary from 'browser-style-dictionary/browser.js'
55
import { tsTypesDeclaration, tsFull, jsFull } from './formats'
@@ -19,7 +19,7 @@ export const stubTokens = async (buildPath: string, force = false) => {
1919
for (const [file, stubbingFunction] of Object.entries(files)) {
2020
const path = `${buildPath}${file}`
2121

22-
if (force && existsSync(path)) { await unlink(path) }
22+
if (force && existsSync(path)) { await rm(path) }
2323

2424
if (!existsSync(path)) { await writeFile(path, stubbingFunction ? stubbingFunction({ tokens: {} }) : '') }
2525
}

src/utils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ export const resolveTokens = (layers: NuxtLayer[]) => {
7878
export const createTokensDir = async (path: string) => {
7979
if (!existsSync(path)) {
8080
await mkdir(path, { recursive: true })
81-
await stubTokens(path, true)
8281
}
8382
}
8483

0 commit comments

Comments
 (0)