diff options
Diffstat (limited to 'packages/main/esbuild.config.js')
-rw-r--r-- | packages/main/esbuild.config.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/packages/main/esbuild.config.js b/packages/main/esbuild.config.js index 996ec5a..ae8565d 100644 --- a/packages/main/esbuild.config.js +++ b/packages/main/esbuild.config.js | |||
@@ -1,9 +1,15 @@ | |||
1 | import { readdir } from 'node:fs/promises'; | ||
2 | import path from 'node:path'; | ||
3 | |||
1 | import getRepoInfo from 'git-repo-info'; | 4 | import getRepoInfo from 'git-repo-info'; |
2 | 5 | ||
3 | import { node } from '../../config/buildConstants.js'; | 6 | import { node } from '../../config/buildConstants.js'; |
4 | import fileUrlToDirname from '../../config/fileUrlToDirname.js'; | 7 | import fileUrlToDirname from '../../config/fileUrlToDirname.js'; |
5 | import getEsbuildConfig from '../../config/getEsbuildConfig.js'; | 8 | import getEsbuildConfig from '../../config/getEsbuildConfig.js'; |
6 | 9 | ||
10 | /** @type {string} */ | ||
11 | const thisDir = fileUrlToDirname(import.meta.url); | ||
12 | |||
7 | const externalPackages = ['electron']; | 13 | const externalPackages = ['electron']; |
8 | 14 | ||
9 | if (process.env.MODE !== 'development') { | 15 | if (process.env.MODE !== 'development') { |
@@ -12,9 +18,12 @@ if (process.env.MODE !== 'development') { | |||
12 | 18 | ||
13 | const gitInfo = getRepoInfo(); | 19 | const gitInfo = getRepoInfo(); |
14 | 20 | ||
21 | /** @type {string[]} */ | ||
22 | const locales = await readdir(path.join(thisDir, '../../locales')); | ||
23 | |||
15 | export default getEsbuildConfig( | 24 | export default getEsbuildConfig( |
16 | { | 25 | { |
17 | absWorkingDir: fileUrlToDirname(import.meta.url), | 26 | absWorkingDir: thisDir, |
18 | entryPoints: ['src/index.ts'], | 27 | entryPoints: ['src/index.ts'], |
19 | outfile: 'dist/index.cjs', | 28 | outfile: 'dist/index.cjs', |
20 | format: 'cjs', | 29 | format: 'cjs', |
@@ -27,5 +36,6 @@ export default getEsbuildConfig( | |||
27 | GIT_SHA: gitInfo.abbreviatedSha, | 36 | GIT_SHA: gitInfo.abbreviatedSha, |
28 | GIT_BRANCH: gitInfo.branch, | 37 | GIT_BRANCH: gitInfo.branch, |
29 | BUILD_DATE: Date.now(), | 38 | BUILD_DATE: Date.now(), |
39 | SUPPORTED_LOCALES: locales, | ||
30 | }, | 40 | }, |
31 | ); | 41 | ); |