Skip to content

Commit bea8053

Browse files
committed
feat: development mode using NODE_ENV
1 parent 3897cc4 commit bea8053

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

bin/index.mjs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
import { createHarmonix } from '../dist/index.mjs'
44
import 'dotenv/config'
55

6+
process.env.NODE_ENV = 'development'
7+
68
const init = async () => {
7-
await createHarmonix(
8-
{ rootDir: './playground' },
9-
{ cwd: './playground' },
10-
true
11-
)
9+
await createHarmonix({ rootDir: './playground' }, { cwd: './playground' })
1210
}
1311

1412
init()

src/harmonix.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,7 @@ const watchReload = (
110110

111111
export const createHarmonix = async (
112112
config: HarmonixConfig = {},
113-
opts: LoadConfigOptions = {},
114-
devMode: boolean = false
113+
opts: LoadConfigOptions = {}
115114
) => {
116115
if (!process.env.DISCORD_CLIENT_TOKEN) {
117116
createError(
@@ -122,7 +121,7 @@ export const createHarmonix = async (
122121

123122
consola.log(colors.blue(`Harmonix ${colors.bold(version)}\n`))
124123
await loadHarmonix(harmonix, config, opts)
125-
if (devMode) {
124+
if (process.env.NODE_ENV === 'development') {
126125
watchReload(harmonix, config, opts)
127126
}
128127

0 commit comments

Comments
 (0)