Skip to content

Commit 70cef2d

Browse files
fix (TCDICORE-340): fix env variables imports
1 parent f8ce6fc commit 70cef2d

2 files changed

Lines changed: 5 additions & 4 deletions

File tree

wp-react-lib/src/api/index.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
import type { PageResponse } from "../post-type"
22
import type { DgSettings, Media } from "../types"
33

4-
const API_ROOT = process.env.VITE_REACT_APP_WP_API ?? '/wp/wp-json'
4+
// @ts-ignore Types not available
5+
const API_ROOT = import.meta.env.VITE_REACT_APP_WP_API ?? process.env.VITE_REACT_APP_WP_API ?? '/wp/wp-json'
56
const URL_MENU = API_ROOT + '/menus/v1/menus/'
67

78
const URL_API_BASE = API_ROOT + '/wp/v2/'
89

910
const URL_PAGE = API_ROOT + '/wp/v2/pages'
10-
11-
const URL_SEARCH = API_ROOT + (process.env.VITE_REACT_APP_WP_SEARCH_END_POINT ?? '/wp/v2/search')
11+
// @ts-ignore
12+
const URL_SEARCH = API_ROOT + (import.meta.env.VITE_REACT_APP_WP_SEARCH_END_POINT ?? process.env.VITE_REACT_APP_WP_SEARCH_END_POINT ?? '/wp/v2/search')
1213

1314
const URL_MEDIA = API_ROOT + '/wp/v2/media'
1415

wp-react-lib/vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export default defineConfig({
2222
copyPublicDir: false,
2323
lib: {
2424
entry: resolve(__dirname, 'src/index.js'),
25-
name: '@devgateway/dvz-ui'
25+
name: '@devgateway/wp-react-lib'
2626
},
2727
commonjsOptions: {
2828
transformMixedEsModules: true,

0 commit comments

Comments
 (0)