Skip to content

Commit 6a1e1aa

Browse files
committed
Fix indentation
1 parent b2f5928 commit 6a1e1aa

File tree

1 file changed

+30
-31
lines changed

1 file changed

+30
-31
lines changed

common/scripts/env-webpack-helper.js

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -26,35 +26,34 @@
2626
* @returns {Object} Environment variables object ready for webpack.DefinePlugin
2727
*/
2828
function createEnvDefinePlugin(env) {
29-
30-
const envKeys = Object.create(null);
31-
const missingVars = [];
32-
33-
if (env) {
34-
Object.entries(env).forEach(([key, value]) => {
35-
if (value !== undefined && value !== '') {
36-
envKeys[`process.env.${key}`] = JSON.stringify(value);
37-
}
38-
else if (process.env[key] !== undefined && process.env[key] !== '') {
39-
envKeys[`process.env.${key}`] = JSON.stringify(process.env[key]);
40-
}
41-
else {
42-
missingVars.push(key);
43-
}
44-
});
45-
}
46-
47-
if (missingVars.length > 0) {
48-
throw new Error(
49-
`Missing required environment variables: ${missingVars.join(', ')}\n` +
50-
`Please provide values in either .env file or runtime environment.\n`
51-
);
52-
}
53-
54-
return envKeys;
29+
30+
const envKeys = Object.create(null);
31+
const missingVars = [];
32+
33+
if (env) {
34+
Object.entries(env).forEach(([key, value]) => {
35+
if (value !== undefined && value !== '') {
36+
envKeys[`process.env.${key}`] = JSON.stringify(value);
37+
}
38+
else if (process.env[key] !== undefined && process.env[key] !== '') {
39+
envKeys[`process.env.${key}`] = JSON.stringify(process.env[key]);
40+
}
41+
else {
42+
missingVars.push(key);
43+
}
44+
});
45+
}
46+
47+
if (missingVars.length > 0) {
48+
throw new Error(
49+
`Missing required environment variables: ${missingVars.join(', ')}\n` +
50+
`Please provide values in either .env file or runtime environment.\n`
51+
);
5552
}
56-
57-
module.exports = {
58-
createEnvDefinePlugin
59-
};
60-
53+
54+
return envKeys;
55+
}
56+
57+
module.exports = {
58+
createEnvDefinePlugin
59+
};

0 commit comments

Comments
 (0)