-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadd.vite.ts
More file actions
36 lines (32 loc) · 807 Bytes
/
Copy pathadd.vite.ts
File metadata and controls
36 lines (32 loc) · 807 Bytes
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
import { brightGreen } from "./deps.ts"
import { presets } from "./templates/tailwind.ts"
import {
create_directories,
create_files,
exec,
insert_content,
stdOut,
} from "./actions.ts"
export const fns = {
create_directories,
create_files,
stdOut,
exec,
insert_content,
}
export async function create_vite_configs(): Promise<void> {
const {
templates: t,
} = presets["tailwind"]
// todo e2e
fns.insert_content(t["patch.vite.css"], "styles.css")
fns.create_directories(presets["tailwind"].directories)
fns.create_files(presets["tailwind"])
await fns.exec(_npm_install())
fns.stdOut(`\nTry ${brightGreen("npm run dev!")}\n`)
}
function _npm_install(): string[] {
return Deno.build.os === "windows"
? ["cmd", "/c", "npm", "install"]
: ["npm", "install"]
}