MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / setup

Function setup

packages/frontend/build.ts:27–56  ·  view source on GitHub ↗
(build)

Source from the content-addressed store, hash-verified

25 return {
26 name: 'unocss',
27 setup(build) {
28
29 let filenames_set = new Set<string>()
30
31 build.onStart(() => {
32 filenames_set.clear()
33 })
34
35 build.onLoad({filter: /\.tsx$/}, args => {
36 filenames_set.add(args.path)
37 return null
38 })
39
40 // Generate CSS from all processed files
41 build.onEnd(async () => {
42
43 let uno = await unocss.createGenerator(uno_config)
44
45 let filenames = Array.from(filenames_set)
46 let files = await Promise.all(filenames.map(
47 filename => fsp.readFile(filename, 'utf-8')
48 ))
49
50 let res = await uno.generate(files.join('\n'))
51
52 await fsp.writeFile(output_file, res.css)
53
54 return null
55 })
56 }
57 }
58}
59

Callers

nothing calls this directly

Calls 1

clearMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…