Skip to content

Commit

Permalink
fix(desktop): define flat version env variable (#1919)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyrious authored May 10, 2023
1 parent 9704ea1 commit f113eff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 3 additions & 0 deletions packages/flat-vite-plugins/dotenv.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const { version } = require("../../scripts/constants.js");
const { configRegion } = require("../../scripts/utils/auto-choose-config.js");
const dotenvReal = require("dotenv");
const { expand } = require("dotenv-expand");
Expand Down Expand Up @@ -38,6 +39,8 @@ exports.dotenv = function dotenv(envDir) {
define["process.env.FLAT_REGION"] = JSON.stringify(configRegion());
}

define["process.env.VERSION"] = JSON.stringify(version);

config.define = { ...config.define, ...define };
},
};
Expand Down
3 changes: 0 additions & 3 deletions web/flat-web/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ import { defineConfig } from "vite";
import { dotenv } from "@netless/flat-vite-plugins/dotenv";
import { reactVirtualized } from "@netless/flat-vite-plugins/react-virtualized";
import { injectHtmlHash } from "./scripts/vite-plugin-html-hash";
import { version } from "./scripts/vite-plugin-version";
import { inlineAssets } from "./scripts/vite-plugin-inline-assets";
import { injectGtag } from "./scripts/vite-plugin-html-gtag";
import { mainPackageJSONPath } from "../../scripts/constants";
import { autoChooseConfig } from "../../scripts/utils/auto-choose-config";
import viteCompression from "vite-plugin-compression";

Expand All @@ -31,7 +29,6 @@ export default defineConfig({
dotenv(autoChooseConfig()),
injectGtag(),
injectHtmlHash(),
version(mainPackageJSONPath),
inlineAssets(),
reactVirtualized(),
viteCompression({ filter: /\.(js)$/i }),
Expand Down

0 comments on commit f113eff

Please sign in to comment.