@@ -14,46 +14,47 @@ modifications to the Web UI.
1414## Setup
1515
16161 . Create a ` .env.<ENV_NAME> ` file in the project root
17- 2 . Add ` NODE_ENV =production` key value pair in the file
18- 3 . Add ` VUE_APP_ENV_NAME ` key with the value set to the new environment name
17+ 2 . Add ` VITE_CUSTOM_ENV =production` key value pair in the file
18+ 3 . Add ` VITE_APP_ENV_NAME ` key with the value set to the new environment name
1919
2020Example ` .env.ibm ` :
2121
2222```
23- NODE_ENV =production
24- VUE_APP_ENV_NAME =ibm
23+ VITE_CUSTOM_ENV =production
24+ VITE_APP_ENV_NAME =ibm
2525```
2626
2727## Store
2828
2929::: tip
30- [ Vuex store modules ] ( https://vuex .vuejs.org/guide/modules.html ) contain the
30+ [ Pinia store core concepts ] ( https://pinia .vuejs.org/core-concepts/ ) contain the
3131application's API calls.
3232:::
3333
34- 1 . If making customizations to the default store, add ` CUSTOM_STORE =true` key
34+ 1 . If making customizations to the default store, add ` VITE_CUSTOM_STORE =true` key
3535 value pair to the new .env file.
36362 . Create a ` <ENV_NAME>.js ` file in ` src/env/store `
3737 ::: danger
38- The filename needs to match the ` VUE_APP_ENV_NAME ` value defined in the
38+ The filename needs to match the ` VITE_APP_ENV_NAME ` value defined in the
3939 .env file. The store import in ` src/main.js ` will resolve to this new
4040 file.
4141 :::
42423 . Import the base store
43434 . Import environment specific store modules
44- 5 . Use the [ Vuex] ( https://vuex.vuejs.org/api/#registermodule ) ` registerModule `
45- and ` unregisterModule ` instance methods to add/remove store modules
44+ 5 . Assign the Objects required to the base store.
46456 . Add default export
4746
4847Example ` src/env/store/ibm.js ` :
4948
5049```
51- import store from '@/store; //@ aliases to src directory
52- import HmcStore from './Hmc/HmcStore ';
50+ import stores from '@/store; //@ aliases to src directory
51+ import DumpsStore from '../../store/modules/Logs/DumpsStore.js ';
5352
54- store.registerModule('hmc', HmcStore);
53+ Object.assign(stores, {
54+ DumpsStore: DumpsStore,
55+ });
5556
56- export default store ;
57+ export default stores ;
5758```
5859
5960## Router
@@ -63,11 +64,11 @@ export default store;
6364accessible in the UI.
6465:::
6566
66- 1 . If making customizations to the default router, add ` CUSTOM_ROUTER =true` key
67+ 1 . If making customizations to the default router, add ` VITE_CUSTOM_ROUTER =true` key
6768 value pair to the new .env file.
68692 . Create a ` <ENV_NAME>.js ` file in ` src/env/router `
6970 ::: danger
70- The filename needs to match the ` VUE_APP_ENV_NAME ` value defined in the
71+ The filename needs to match the ` VITE_APP_ENV_NAME ` value defined in the
7172 .env file. The routes import in ` src/router/index.js ` will resolve to this
7273 new file.
7374 :::
@@ -86,17 +87,17 @@ application routes which is not always the same as what is visible in the app
8687navigation. This configuration will make customizations to the rendered markup
8788in src/components/AppNavigation/AppNavigation.vue.
8889
89- 1 . If making customizations to the app navigation, add ` CUSTOM_APP_NAV =true` key
90+ 1 . If making customizations to the app navigation, add ` VITE_CUSTOM_APP_NAV =true` key
9091 value pair to the new .env file.
91922 . Create a ` <ENV_NAME>.js ` file in ` src/env/components/AppNavigation `
9293 ::: danger
93- The filename needs to match the ` VUE_APP_ENV_NAME ` value defined in the
94- .env file. The AppNavigationMixin import in
94+ The filename needs to match the ` VITE_APP_ENV_NAME ` value defined in the
95+ .env file. The AppNavigationData import in
9596 ` src/components/AppNavigation/AppNavigation.vue ` will resolve to this new
9697 file.
9798 :::
98993 . Your custom mixin should follow a very similar structure to the default
99- AppNavigationMixin .js file. It should include a data property named
100+ AppNavigationData .js file. It should include a data property named
100101 ` navigationItems ` that should be an array of of navigation objects. Each
101102 navigation object should have an ` id ` and ` label ` property defined.
102103 Optionally it can include ` icon ` , ` route ` , or ` children ` properties.
@@ -109,11 +110,11 @@ in src/components/AppNavigation/AppNavigation.vue.
109110allows for easy visual customizations.
110111:::
111112
112- 1 . If making customizations to the default styles, add ` CUSTOM_STYLES =true` key
113+ 1 . If making customizations to the default styles, add ` VITE_CUSTOM_STYLES =true` key
113114 value pair to the new .env file.
1141152 . Create a ` _<ENV_NAME>.scss ` partial in ` src/env/assets/styles `
115116 ::: danger
116- The filename needs to match the ` VUE_APP_ENV_NAME ` value defined in the
117+ The filename needs to match the ` VITE_APP_ENV_NAME ` value defined in the
117118 .env file. The webpack sass loader will attempt to import a file with this
118119 name.
119120 :::
@@ -136,8 +137,8 @@ $success: lime;
136137
137138## Local development
138139
139- 1 . Add the same ` VUE_APP_ENV_NAME ` key value pair to your
140- ` env.development. local ` file.
140+ 1 . Add the same ` VITE_APP_ENV_NAME ` key value pair to your
141+ ` env.local ` file.
1411422 . Use serve script
142143 ```
143144 npm run serve
@@ -158,5 +159,5 @@ npm run build -- --mode ibm
158159pass env variable directly to script
159160
160161```
161- VUE_APP_ENV_NAME =ibm npm run build
162+ VITE_APP_ENV_NAME =ibm npm run build
162163```
0 commit comments