Skip to content

Commit bb33a44

Browse files
committed
workflow(dev): should delete node_modules after upgrading pnpm
1 parent 3a5ed3d commit bb33a44

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scripts/dev.mts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// pnpm i only-allow esno prompts cross-spawn kolorist magicast -D -w
1+
// pnpm i only-allow esno prompts cross-spawn kolorist magicast del -D -w
22

33
import fs from 'node:fs'
44
import { execSync } from 'node:child_process'
@@ -8,6 +8,7 @@ import { loadFile, writeFile } from 'magicast'
88
import type { ASTNode } from 'magicast'
99
import { cyan } from 'kolorist'
1010
import { addVitePlugin } from 'magicast/helpers'
11+
import { deleteAsync } from 'del'
1112

1213
declare const process: NodeJS.Process
1314

@@ -178,6 +179,8 @@ async function dev() {
178179
spawn.sync('pnpm', ['env', 'use', '-g', 'lts'], { stdio: 'inherit' })
179180
console.log(cyan('Installing global packages...'))
180181
spawn('pnpm', ['add', 'cnpm', '@antfu/ni', '-g'], { stdio: 'inherit' })
182+
console.log(cyan('Deleting ./node_modules...'))
183+
await deleteAsync(['./node_modules'])
181184
} catch (e) {
182185

183186
}

0 commit comments

Comments
 (0)