mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
fix: package env vars (#9221)
This commit is contained in:
parent
d92384b77d
commit
70c3e921bb
3 changed files with 19 additions and 7 deletions
|
@ -4,14 +4,14 @@ const pkg = require("./package.json");
|
|||
const parseEnvVariables = (filepath) => {
|
||||
const envVars = Object.entries(dotenv.parse(readFileSync(filepath))).reduce(
|
||||
(env, [key, value]) => {
|
||||
env[key] = JSON.stringify(value);
|
||||
env[key] = value;
|
||||
return env;
|
||||
},
|
||||
{},
|
||||
);
|
||||
envVars.VITE_PKG_NAME = JSON.stringify(pkg.name);
|
||||
envVars.VITE_PKG_VERSION = JSON.stringify(pkg.version);
|
||||
envVars.VITE_IS_EXCALIDRAW_NPM_PACKAGE = JSON.stringify(true);
|
||||
envVars.VITE_PKG_NAME = pkg.name;
|
||||
envVars.VITE_PKG_VERSION = pkg.version;
|
||||
envVars.VITE_IS_EXCALIDRAW_NPM_PACKAGE = true;
|
||||
return envVars;
|
||||
};
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ export class ExcalidrawFontFace {
|
|||
|
||||
private static readonly ASSETS_FALLBACK_URL = `https://esm.sh/${
|
||||
import.meta.env.VITE_PKG_NAME
|
||||
? `${import.meta.env.VITE_PKG_NAME}@${import.meta.env.PKG_VERSION}` // should be provided by vite during package build
|
||||
? `${import.meta.env.VITE_PKG_NAME}@${import.meta.env.VITE_PKG_VERSION}` // should be provided by vite during package build
|
||||
: "@excalidraw/excalidraw" // fallback to latest package version (i.e. for app)
|
||||
}/dist/prod/`;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue