mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-05-10 04:25:01 +00:00
fix: dashboard build errors about API_URL/.env
This commit is contained in:
parent
4b63d03bdb
commit
4c21884016
3 changed files with 22 additions and 39 deletions
|
@ -16,7 +16,7 @@
|
|||
"cross-env": "^7.0.3",
|
||||
"css-loader": "^6.8.1",
|
||||
"cssnano": "^4.1.10",
|
||||
"dotenv-webpack": "^8.0.1",
|
||||
"dotenv": "^16.4.5",
|
||||
"file-loader": "^6.2.0",
|
||||
"html-loader": "^4.2.0",
|
||||
"html-webpack-plugin": "^5.5.3",
|
||||
|
|
|
@ -1,9 +1,11 @@
|
|||
const path = require("path");
|
||||
const { VueLoaderPlugin } = require("vue-loader");
|
||||
const HtmlWebpackPlugin = require("html-webpack-plugin");
|
||||
const DotenvPlugin = require("dotenv-webpack");
|
||||
const { merge } = require("webpack-merge");
|
||||
const webpack = require("webpack");
|
||||
const dotenv = require("dotenv");
|
||||
|
||||
dotenv.config({ path: path.resolve(process.cwd(), "../.env") });
|
||||
|
||||
const targetDir = path.normalize(path.join(__dirname, "dist"));
|
||||
|
||||
|
@ -12,6 +14,11 @@ if (!process.env.NODE_ENV) {
|
|||
process.exit(1);
|
||||
}
|
||||
|
||||
if (!process.env.API_URL) {
|
||||
console.error("API_URL missing from environment variables");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const babelOpts = {
|
||||
presets: ["@babel/preset-env"],
|
||||
};
|
||||
|
@ -150,9 +157,6 @@ let config = {
|
|||
js: ["./src/main.ts"],
|
||||
},
|
||||
}),
|
||||
new DotenvPlugin({
|
||||
path: path.resolve(process.cwd(), "../.env"),
|
||||
}),
|
||||
new webpack.EnvironmentPlugin(["API_URL"]),
|
||||
],
|
||||
resolve: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue