File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ import { defineConfig } from "vite";
1111import dts from "vite-plugin-dts" ;
1212import externalGlobals from "rollup-plugin-external-globals" ;
1313
14+ import { version } from "./package.json" with { type : "json" } ;
15+
1416const __dirname = dirname ( fileURLToPath ( import . meta. url ) ) ;
1517
1618export default defineConfig ( {
@@ -32,7 +34,9 @@ export default defineConfig({
3234 } ) ,
3335 ] ,
3436 define : {
35- __VERSION__ : JSON . stringify ( process . env . npm_package_version ) ,
37+ // We cannot use `process.env.npm_package_version` as when building element-web with module-api set to `workspace`
38+ // this would contain the version of element-web rather than that of the module-api.
39+ __VERSION__ : JSON . stringify ( version ) ,
3640 // Use production mode for the build as it is tested against production builds of Element Web,
3741 // this is required for React JSX versions to be compatible.
3842 process : { env : { NODE_ENV : "production" } } ,
You can’t perform that action at this time.
0 commit comments