kc params from env

This commit is contained in:
Primakov Alexandr Alexandrovich 2025-01-07 16:20:20 +03:00
parent cc7f3d3371
commit a7168231a1
5 changed files with 899 additions and 1787 deletions

View File

@ -1,3 +1,5 @@
const webpack = require('webpack');
const pkg = require('./package')
module.exports = {
@ -6,6 +8,13 @@ module.exports = {
output: {
publicPath: `/static/${pkg.name}/${process.env.VERSION || pkg.version}/`,
},
plugins: [
new webpack.DefinePlugin({
KC_URL: process.env.KC_URL || '"https://kc.bro-js.ru"',
KC_REALM: process.env.KC_REALM || '"bro-js"',
KC_CLIENT_ID: process.env.KC_CLIENT_ID || '"microfrontend-admin"',
}),
],
},
navigations: {
'journal.main': '/journal.pl',

24
index.d.ts vendored
View File

@ -1,6 +1,24 @@
declare const IS_PROD: string
declare const KC_URL: string
declare const KC_REALM: string
declare const KC_CLIENT_ID: string
declare module '*.svg' {
const src: string;
export default src;
const value: string
export default value
}
declare const __webpack_public_path__: string;
declare module '*.jpg' {
const value: string
export default value
}
declare module '*.png' {
const value: string
export default value
}
declare const __webpack_public_path__: string

2643
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -25,7 +25,7 @@
"eslint-plugin-react": "^7.34.1"
},
"dependencies": {
"@brojs/cli": "^0.0.4-beta.0",
"@brojs/cli": "^1.8.4",
"@chakra-ui/icons": "^2.1.1",
"@chakra-ui/react": "^2.8.2",
"@emotion/react": "^11.11.4",

View File

@ -1,9 +1,7 @@
import Keycloak from 'keycloak-js';
export const keycloak = new Keycloak({
url: 'https://kc.bro-js.ru',
realm: 'bro-js',
clientId: 'journal'
url: KC_URL,
realm: KC_REALM,
clientId: KC_CLIENT_ID,
});
window.keycloak = keycloak;