- Create dev-with-env.sh script to load .env before build - Add npm run dev:tauri command that uses the script - Document why .env must be loaded before compilation - Explain compile-time vs runtime environment variables The issue: option_env!() reads vars at compile time, but .env loads at runtime. Solution: source .env before cargo build. cp
11 lines
147 B
Bash
Executable File
11 lines
147 B
Bash
Executable File
#!/bin/bash
|
|
# Development script that loads .env variables before building
|
|
|
|
set -a
|
|
if [ -f .env ]; then
|
|
source .env
|
|
fi
|
|
set +a
|
|
|
|
npm run tauri dev
|