Use env in astro config file

This commit is contained in:
DrMint 2024-03-10 21:24:36 +01:00
parent 5d1b088b07
commit c1f97ce86e
4 changed files with 12676 additions and 6 deletions

View File

@ -2,6 +2,8 @@ import icon from "astro-icon";
import { defineConfig } from "astro/config";
import node from "@astrojs/node";
import astroMetaTags from "astro-meta-tags";
import { loadEnv } from "vite";
const { ASTRO_PORT, ASTRO_HOST } = loadEnv(process.env.NODE_ENV, process.cwd(), "");
// https://astro.build/config
export default defineConfig({
@ -22,7 +24,9 @@ export default defineConfig({
],
// devToolbar: { enabled: false },
server: {
port: 12499,
host: true,
port: parseInt(ASTRO_PORT),
host: ASTRO_HOST,
},
});
console.log(import.meta.env)

12665
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -9,11 +9,11 @@
"preview": "astro preview",
"astro": "astro",
"upgrade": "ncu",
"script:download-payload-sdk": "bun run scripts/download-payload-sdk.ts",
"script:download-currencies": "bun run scripts/download-currencies.ts",
"script:download-wording-keys": "bun run scripts/download-wording-keys.ts",
"script:download-payload-sdk": "npm run scripts/download-payload-sdk.ts",
"script:download-currencies": "npm run scripts/download-currencies.ts",
"script:download-wording-keys": "npm run scripts/download-wording-keys.ts",
"prettier": "prettier --write --list-different --plugin=prettier-plugin-astro .",
"precommit": "bun run script:download-wording-keys && bun run script:download-payload-sdk && bun run prettier && bun run astro check"
"precommit": "npm run script:download-wording-keys && npm run script:download-payload-sdk && npm run prettier && npm run astro check"
},
"engines": {
"npm": ">=10.0.0",

1
run_accords_dev.sh Executable file
View File

@ -0,0 +1 @@
npm run dev