Skip to content

Commit

Permalink
fix(vite-node): fix cb func argument for change event (#1319)
Browse files Browse the repository at this point in the history
  • Loading branch information
togami2864 committed May 17, 2022
1 parent 5af545d commit b228edb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/vite-node/src/cli.ts
@@ -1,5 +1,5 @@
import cac from 'cac'
import { dim, red } from 'kolorist'
import { cyan, dim, red } from 'kolorist'
import { createServer } from 'vite'
import { version } from '../package.json'
import { ViteNodeServer } from './server'
Expand Down Expand Up @@ -66,9 +66,9 @@ async function run(files: string[], options: CliOptions = {}) {
if (!options.watch)
await server.close()

server.watcher.on('change', async (eventName, path) => {
server.watcher.on('change', async (path) => {
// eslint-disable-next-line no-console
console.log(dim(`[${eventName}] ${path}`))
console.log(`${cyan('[vite-node]')} File change detected. ${dim(path)}`)

// invalidate module cache but not node_modules
Array.from(runner.moduleCache.keys())
Expand Down

0 comments on commit b228edb

Please sign in to comment.