mirror of
https://gitee.com/eolink_admin/postcat.git
synced 2024-11-30 10:47:41 +08:00
chore: change angular.json beforeBuild
This commit is contained in:
parent
5cc1371837
commit
3b921a8984
@ -58,10 +58,15 @@ function createWindow(): BrowserWindow {
|
||||
mockServer.start(win as any);
|
||||
proxyOpenExternal(win);
|
||||
let loadPage = async () => {
|
||||
let currentUrl = win.webContents.getURL();
|
||||
let locale = ['zh-Hans', 'en-US'].find((val) => currentUrl.includes(val));
|
||||
const file: string =
|
||||
processEnv === 'development'
|
||||
? 'http://localhost:4200'
|
||||
: `file://${path.join(__dirname, '../../../src/workbench/browser/dist/en-US/index.html')}`;
|
||||
: `file://${path.join(
|
||||
__dirname,
|
||||
`../../../src/workbench/browser/dist/${locale || app.getLocale()}/index.html`
|
||||
)}`;
|
||||
win.loadURL(file);
|
||||
if (['development'].includes(processEnv)) {
|
||||
win.webContents.openDevTools({
|
||||
|
@ -10,7 +10,9 @@
|
||||
"eoapi": {
|
||||
"root": "",
|
||||
"i18n": {
|
||||
"sourceLocale": "zh-Hans",
|
||||
"sourceLocale": {
|
||||
"code": "zh-Hans"
|
||||
},
|
||||
"locales": {
|
||||
"en-US": {
|
||||
"translation": "src/locale/messages.en-US.xlf"
|
||||
|
2750
src/workbench/browser/package-lock.json
generated
2750
src/workbench/browser/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -5,9 +5,8 @@
|
||||
"scripts": {
|
||||
"ng": "ng",
|
||||
"start": "ng serve -c web -o",
|
||||
"build": "ng build --base-href ./",
|
||||
"build:dev": "yarn build -- -c dev",
|
||||
"build:prod": "yarn build -- -c production",
|
||||
"beforeBuild": "node ./build.js",
|
||||
"build": "npm run beforeBuild&&ng build --base-href ./",
|
||||
"build:web": "ng build -c production",
|
||||
"ng:serve": "ng serve -c web -o",
|
||||
"i18n:gen": "ng extract-i18n --output-path src/locale",
|
||||
@ -19,6 +18,7 @@
|
||||
"lint": "ng lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@angular-cli/base-href-webpack": "1.0.16",
|
||||
"@angular/animations": "14.0.3",
|
||||
"@angular/cdk": "14.0.3",
|
||||
"@angular/common": "14.0.3",
|
||||
|
@ -64,7 +64,7 @@ export class LanguageSwticherComponent implements OnInit {
|
||||
// },
|
||||
// });
|
||||
// } else {
|
||||
changeCallback(inputLocaleID);
|
||||
changeCallback(inputLocaleID);
|
||||
// }
|
||||
}
|
||||
}
|
||||
|
@ -28,6 +28,11 @@
|
||||
tsconfig-paths "^3.9.0"
|
||||
webpack-merge "^5.7.3"
|
||||
|
||||
"@angular-cli/base-href-webpack@1.0.16":
|
||||
version "1.0.16"
|
||||
resolved "https://registry.yarnpkg.com/@angular-cli/base-href-webpack/-/base-href-webpack-1.0.16.tgz#4296a2ff7db84ddc2e67c2a107e276f72463ff8d"
|
||||
integrity sha512-AP30Bg1eIf9m92XfpSYGlvNWq2w0u+QbI/aY0Gi6YGllFZ/5gjWIVJxFXxybqk5assuL41Ew0i3nen+1bH2Y5A==
|
||||
|
||||
"@angular-devkit/architect@0.1400.3", "@angular-devkit/architect@>=0.1400.0 < 0.1500.0":
|
||||
version "0.1400.3"
|
||||
resolved "https://registry.yarnpkg.com/@angular-devkit/architect/-/architect-0.1400.3.tgz#c83e0ef6643f1f76fec12d330b296a2e70bfefa5"
|
||||
|
Loading…
Reference in New Issue
Block a user