Skip to content

Commit 9c276a8

Browse files
authored
[Tech] Source map support for the Backend (#3823)
1 parent 00ce6fd commit 9c276a8

File tree

4 files changed

+24
-3
lines changed

4 files changed

+24
-3
lines changed

electron.vite.config.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export default defineConfig(({ mode }) => ({
3535
input: 'src/backend/main.ts'
3636
},
3737
outDir: 'build/main',
38-
minify: mode === 'production',
38+
minify: true,
3939
sourcemap: mode === 'development' ? 'inline' : false
4040
},
4141
resolve: { alias: srcAliases },
@@ -47,7 +47,7 @@ export default defineConfig(({ mode }) => ({
4747
input: 'src/backend/preload.ts'
4848
},
4949
outDir: 'build/preload',
50-
minify: mode === 'production',
50+
minify: true,
5151
sourcemap: mode === 'development' ? 'inline' : false
5252
},
5353
resolve: { alias: srcAliases },
@@ -62,7 +62,7 @@ export default defineConfig(({ mode }) => ({
6262
target: 'esnext',
6363
outDir: 'build',
6464
emptyOutDir: false,
65-
minify: mode === 'production',
65+
minify: true,
6666
sourcemap: mode === 'development' ? 'inline' : false
6767
},
6868
resolve: { alias: srcAliases },

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898
"shlex": "2.1.2",
9999
"short-uuid": "4.2.2",
100100
"simple-keyboard": "3.5.33",
101+
"source-map-support": "^0.5.21",
101102
"steam-shortcut-editor": "3.1.3",
102103
"tslib": "2.5.0",
103104
"xvfb-maybe": "^0.2.1",
@@ -124,6 +125,7 @@
124125
"@types/react-router-dom": "5.3.3",
125126
"@types/sanitize-html": "2.9.0",
126127
"@types/semver": "^7.5.8",
128+
"@types/source-map-support": "^0.5.10",
127129
"@types/tmp": "0.2.3",
128130
"@typescript-eslint/eslint-plugin": "5.47.1",
129131
"@typescript-eslint/parser": "5.47.1",

pnpm-lock.yaml

+18
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/backend/main.ts

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
readdirSync,
3535
readFileSync
3636
} from 'graceful-fs'
37+
import 'source-map-support/register'
3738

3839
import Backend from 'i18next-fs-backend'
3940
import i18next from 'i18next'

0 commit comments

Comments
 (0)