This document provides instructions for how to add environment specific modifications to the Web UI.
.env.<ENV_NAME> file in the project rootNODE_ENV=production key value pair in the fileVUE_APP_ENV_NAME key with the value set to the new environment nameExample .env.ibm:
NODE_ENV=production VUE_APP_ENV_NAME=ibm
Vuex store modules contain the application's API calls.
<ENV_NAME>.js file in src/env/storeThe filename needs to match the
VUE_APP_ENV_NAMEvalue defined in the .env file. The store import insrc/main.jswill resolve to this new file.
registerModule and unregisterModule instance methods to add/remove store modulesExample src/env/store/ibm.js:
import store from '@/store; //@ aliases to src directory
import HmcStore from './Hmc/HmcStore';
store.registerModule('hmc', HmcStore);
export default store;
Vue Router determines which pages are accessible in the UI.
<ENV_NAME>.js file in src/env/routerThe filename needs to match the
VUE_APP_ENV_NAMEvalue defined in the .env file. The router import insrc/main.jswill resolve to this new file.
addRoutes instance method to define new routesExample src/env/router/ibm.js:
import router from '@/router'; //@ aliases to src directory
import AppLayout from '@/layouts/AppLayout';
router.addRoutes([
{
path: '/',
component: AppLayout,
children: [
{
path: '/access-control/hmc',
component: () => import('../views/Hmc'),
meta: {
title: 'appPageTitle.hmc'
}
}
]
}
]);
export default router;
Bootstrap theming allows for easy visual customizations.
_<ENV_NAME>.scss partial in src/env/assets/stylesThe filename needs to match the
VUE_APP_ENV_NAMEvalue defined in the .env file. The webpack sass loader will attempt to import a file with this name.
Example for adding custom colors
src/env/assets/styles/_ibm.scss
// Custom theme colors $primary: rebeccapurple; $success: lime;
VUE_APP_ENV_NAME key value pair to your env.development.local file.npm run serve
Run npm build script with vue-cli --mode option flag. This requires corresponding .env file to exist.
npm run build -- --mode ibm
OR
pass env variable directly to script
VUE_APP_ENV_NAME=ibm npm run build