-
Notifications
You must be signed in to change notification settings - Fork 0
/
vue.config.js
42 lines (38 loc) · 1.05 KB
/
vue.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Support storing environment variables in a file named ".okta.env"
const path = require('path');
const dotenv = require('dotenv');
const fs = require('fs');
// Read environment variables from ".okta.env". Override environment vars if they are already set.
const OKTAENV = path.resolve(__dirname, '.', '.okta.env');
if (fs.existsSync(OKTAENV)) {
const envConfig = dotenv.parse(fs.readFileSync(OKTAENV));
Object.keys(envConfig).forEach((k) => {
process.env[k] = envConfig[k];
});
}
const env = {};
// List of environment variables made available to the app
[
'ISSUER',
'CLIENT_ID',
].forEach(function (key) {
if (!process.env[key]) {
throw new Error(`Environment variable ${key} must be set. See README.md`);
}
env[key] = JSON.stringify(process.env[key]);
});
module.exports = {
chainWebpack: config => {
config
.plugin('define')
.tap(args => {
const base = args[0]['process.env'];
args[0]['process.env'] = {
...base,
...env,
};
return args;
})
},
runtimeCompiler: true
}