mirror of
https://github.com/plebbit/seedit.git
synced 2025-12-23 22:17:55 -05:00
fix: react-scan was included in production builds
This commit is contained in:
8
.github/workflows/release.yml
vendored
8
.github/workflows/release.yml
vendored
@@ -35,7 +35,7 @@ jobs:
|
||||
with:
|
||||
node-version: 22
|
||||
- name: Build React app (with Node v22)
|
||||
run: CI='' yarn build
|
||||
run: CI='' NODE_ENV=production yarn build
|
||||
- name: Build Electron app for Linux (with Node v22)
|
||||
run: yarn electron:build:linux
|
||||
- name: List dist directory
|
||||
@@ -82,7 +82,7 @@ jobs:
|
||||
with:
|
||||
node-version: 22
|
||||
- name: Build React app (with Node v22)
|
||||
run: CI='' yarn build
|
||||
run: CI='' NODE_ENV=production yarn build
|
||||
- name: Build Electron app for Mac (with Node v22)
|
||||
run: yarn electron:build:mac
|
||||
- name: List dist directory
|
||||
@@ -116,7 +116,7 @@ jobs:
|
||||
- name: Install dependencies (with Node v22) # --network-timeout and --network-concurrency are yarn v1 flags.
|
||||
run: yarn install --frozen-lockfile --network-timeout 100000 --network-concurrency 1
|
||||
- name: Build React app (with Node v22)
|
||||
run: yarn build
|
||||
run: NODE_ENV=production yarn build
|
||||
- name: Build Electron app for Windows (with Node v22)
|
||||
run: yarn electron:build:windows
|
||||
- name: List dist directory
|
||||
@@ -158,7 +158,7 @@ jobs:
|
||||
- name: Install dependencies (with Node v20)
|
||||
run: yarn install --frozen-lockfile --ignore-engines
|
||||
# build react app
|
||||
- run: CI='' yarn build
|
||||
- run: CI='' NODE_ENV=production yarn build
|
||||
# set android versionCode and versionName
|
||||
- run: sed -i "s/versionCode 1/versionCode $(git tag | wc -l)/" ./android/app/build.gradle
|
||||
- run: sed -i "s/versionName \"1.0\"/versionName \"$(node -e "console.log(require('./package.json').version)")\"/" ./android/app/build.gradle
|
||||
|
||||
@@ -59,12 +59,12 @@
|
||||
},
|
||||
"scripts": {
|
||||
"start": "vite",
|
||||
"build": "cross-env PUBLIC_URL=./ GENERATE_SOURCEMAP=false vite build",
|
||||
"build:preload": "vite build --config electron/vite.preload.config.js",
|
||||
"build-netlify": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" PUBLIC_URL=./ GENERATE_SOURCEMAP=true VITE_COMMIT_REF=$COMMIT_REF CI='' vite build",
|
||||
"build": "cross-env NODE_ENV=production PUBLIC_URL=./ GENERATE_SOURCEMAP=false vite build",
|
||||
"build:preload": "cross-env NODE_ENV=production vite build --config electron/vite.preload.config.js",
|
||||
"build-netlify": "cross-env NODE_OPTIONS=\"--max_old_space_size=4096\" NODE_ENV=production PUBLIC_URL=./ GENERATE_SOURCEMAP=true VITE_COMMIT_REF=$COMMIT_REF CI='' vite build",
|
||||
"test": "vitest",
|
||||
"preview": "vite preview",
|
||||
"analyze-bundle": "cross-env PUBLIC_URL=./ GENERATE_SOURCEMAP=true vite build && npx source-map-explorer 'build/assets/*.js'",
|
||||
"analyze-bundle": "cross-env NODE_ENV=production PUBLIC_URL=./ GENERATE_SOURCEMAP=true vite build && npx source-map-explorer 'build/assets/*.js'",
|
||||
"electron": "yarn build:preload && cross-env ELECTRON_IS_DEV=1 yarn electron:before && cross-env ELECTRON_IS_DEV=1 electron .",
|
||||
"electron:no-delete-data": "yarn electron:before:download-ipfs && electron .",
|
||||
"electron:start": "concurrently \"cross-env BROWSER=none yarn start\" \"wait-on http://localhost:3000 && yarn electron\"",
|
||||
|
||||
@@ -7,6 +7,7 @@ import { VitePWA } from 'vite-plugin-pwa';
|
||||
import reactScan from '@react-scan/vite-plugin-react-scan';
|
||||
|
||||
const isProduction = process.env.NODE_ENV === 'production';
|
||||
const isDevelopment = process.env.NODE_ENV === 'development';
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [
|
||||
@@ -19,7 +20,8 @@ export default defineConfig({
|
||||
]
|
||||
}
|
||||
}),
|
||||
!isProduction && reactScan({
|
||||
// Only include React Scan in development mode - never in production builds
|
||||
(isDevelopment || (!isProduction && process.env.NODE_ENV !== 'production')) && reactScan({
|
||||
showToolbar: true,
|
||||
playSound: true,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user