Skip to content

Commit

Permalink
Merge pull request #105 from 15100399015/dev
Browse files Browse the repository at this point in the history
fix: app name miss
  • Loading branch information
15100399015 committed Jul 30, 2023
2 parents cb62b71 + 41188a7 commit b0e00ff
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion solidui-web/config/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const productionVariable = [
const developmentVariable = [
{ name: "NODE_ENV", default: "development" },
{ name: "BASE_ENV", default: "" },
{ name: "PROXY_SERVER", default: "http://localhost:12345" },
{ name: "PROXY_SERVER", default: "http://localhost:1234" },
{ name: "SERVER_PORT", default: 3000 },
]

Expand Down
2 changes: 1 addition & 1 deletion solidui-web/config/webpack.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ module.exports = {
}),
new webpack.DefinePlugin({
"process.env": JSON.stringify(envVariate.filter(isDev, process.env)),
"process.env.APP_NAME": JSON.stringify(process.APP_NAME),
"process.env.APP_NAME": JSON.stringify(process.env.APP_NAME),
"process.env.APP_VERSION": JSON.stringify(process.env.APP_VERSION),
}),
],
Expand Down
12 changes: 6 additions & 6 deletions solidui-web/scripts/start.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,16 @@ function loadEnvFile(envMode) {
const needVariable = envConfig[envMode].needVariable;
// load
dotenv.config({ path: envFile, processEnv: process.env })
if (!checkFileExist([envFile]).status) Logger.logWarn(envFile + " does not exist, will Use default value")
function generateDefaultValue() {
const envDefault = {}
if (!checkFileExist([envFile]).status) Logger.logWarn(envFile + " does not exist, will Use default value \r\n more info please see https://github.com/CloudOrc/SolidUI/blob/dev/solidui-web/README.md")
function fillDefaultValue(envObject) {
for (let i = 0; i < needVariable.length; i++) {
const variable = needVariable[i];
envDefault[variable.name] = variable.default
if (envObject[variable.name] === void 0) {
envObject[variable.name] = variable.default
}
}
return envDefault
}
Object.assign(process.env, generateDefaultValue())
fillDefaultValue(process.env)
const missVariable = verifyEnv(needVariable.map(v => v.name), process.env)
if (missVariable.length) exitProcess(`please check it ${envFile}, ${missVariable.join(',')} miss`)
}
Expand Down

0 comments on commit b0e00ff

Please sign in to comment.