Load .env and vault secrets to client apps.
npm install @crds_npm/rollup-plugin-vaultThis package is used to use env variables from .env file and to load env vars from Vault secrets. Your .env must include the following:
```
CRDS_ENV=local
VAULT_ROLE_ID=
VAULT_SECRET_ID=
CRDS_ENV should be either local, int, or prod.
First, npm install within the project:
``
npm install @alepop/stencil-env --save-dev
Next, within the project's stencil.config.js file, import the plugin and addplugins
it to the config.
#### stencil.config.ts
`ts
import { Config } from '@stencil/core';
import { env } from 'rollup-plugin-vault';
export const config: Config = {
plugins: [
new VaultEnvReplacer({ secrets: ['common', 'components'], vaultUrl: 'https://vault.crossroads.net/', secretFolder: 'kv-client' }).env(),
]
};
`components
You can pass other secret folders in the array of strings as well such as etc.
Add .env file in the root of your project
bash
TEST=test string
`After compilation,
process.env.TEST will be replaced by it variable from .env` file.