Skip to content

Commit

Permalink
add env variable for indicating dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
weswalla committed Sep 7, 2024
1 parent 35590f0 commit 04a69be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion web/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,12 @@ const isElectron = () => {
process.versions.electron != null
)
}
const isDevMode = () => {
return process.env.__DEV_MODE__
}

;(async () => {
if (!isElectron()) {
if (!isElectron() && isDevMode()) {
await initializeHotReload()
}
if (!isWeContext()) {
Expand Down
1 change: 1 addition & 0 deletions web/webpack.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = {
__MAIN_APP_ID__: JSON.stringify(mainAppId),
__ADMIN_PORT__: process.env.ADMIN_WS_PORT,
__APP_PORT__: process.env.APP_WS_PORT,
'process.env.__DEV_MODE__': JSON.stringify(true),
}),
new HTMLWebpackPlugin({
template: './src/index.html', //source
Expand Down

0 comments on commit 04a69be

Please sign in to comment.