Skip to content

Commit

Permalink
refactor: do not watch .adonisrc.json file anymore
Browse files Browse the repository at this point in the history
We are using a TypeScript file now and hence this file is not part
of the sourcecode
  • Loading branch information
thetutlage committed Nov 28, 2023
1 parent f3e3070 commit 9f8c1b6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/dev_server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import type { Watcher } from '@poppinss/chokidar-ts'

import type { DevServerOptions } from './types.js'
import { AssetsDevServer } from './assets_dev_server.js'
import { getPort, isDotEnvFile, isRcFile, runNode, watch } from './helpers.js'
import { getPort, isDotEnvFile, runNode, watch } from './helpers.js'

/**
* Instance of CLIUI
Expand Down Expand Up @@ -182,7 +182,7 @@ export class DevServer {
* Handles a non TypeScript file change
*/
#handleFileChange(action: string, port: string, relativePath: string) {
if (isDotEnvFile(relativePath) || isRcFile(relativePath)) {
if (isDotEnvFile(relativePath)) {
this.#clearScreen()
this.#logger.log(`${this.#colors.green(action)} ${relativePath}`)
this.#restartHTTPServer(port)
Expand Down
7 changes: 0 additions & 7 deletions src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,6 @@ export function isDotEnvFile(filePath: string) {
return filePath.includes('.env.')
}

/**
* Check if file is .adonisrc.json file
*/
export function isRcFile(filePath: string) {
return filePath === '.adonisrc.json'
}

/**
* Returns the port to use after inspect the dot-env files inside
* a given directory.
Expand Down

0 comments on commit 9f8c1b6

Please sign in to comment.