Skip to content

Commit e0cf4c6

Browse files
committed
fix: fix issue with i18n extract on not-prebundled envirtonments: when doing CI in spa tmp, install dev deps also, otherwise vue-i18n-extract is not installed
1 parent 833a2ab commit e0cf4c6

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

adminforth/modules/codeInjector.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,13 +106,18 @@ class CodeInjector implements ICodeInjector {
106106
// console.log(`Command ${command} output:`, out, err);
107107
// }
108108

109-
async runNpmShell({command, cwd}) {
109+
async runNpmShell({command, cwd, envOverrides = {}}: {
110+
command: string,
111+
cwd: string,
112+
envOverrides?: { [key: string]: string }
113+
}) {
110114
const nodeBinary = process.execPath; // Path to the Node.js binary running this script
111115
const npmPath = path.join(path.dirname(nodeBinary), 'npm'); // Path to the npm executable
112116
const env = {
113117
VITE_ADMINFORTH_PUBLIC_PATH: this.adminforth.config.baseUrl,
114118
FORCE_COLOR: '1',
115119
...process.env,
120+
...envOverrides,
116121
};
117122

118123
console.log(`⚙️ exec: npm ${command}`);
@@ -594,7 +599,9 @@ class CodeInjector implements ICodeInjector {
594599
process.env.HEAVY_DEBUG && console.log('🪲Hash file does not exist, proceeding with npm ci/install');
595600
}
596601

597-
await this.runNpmShell({command: 'ci', cwd: this.spaTmpPath()});
602+
await this.runNpmShell({command: 'ci', cwd: this.spaTmpPath(), envOverrides: {
603+
NODE_ENV: 'development' // othewrwise it will not install devDependencies which we still need, e.g for extract
604+
}});
598605

599606
const allPacks = [
600607
...iconPackageNames,

0 commit comments

Comments
 (0)