Revert "refactor: use --env CLI arg" (#2212)

Reverts denoland/fresh#2204

The `--env` flag cannot be used by default because it fails when no
`.env` file is present. Therefore this PR accidentally introduced a
breaking change.
This commit is contained in:
Marvin Hagemeister
2024-01-04 11:53:15 +01:00
committed by GitHub
parent f95df1d7b7
commit 8c4385043c
14 changed files with 22 additions and 14 deletions
+5 -1
View File
@@ -523,6 +523,8 @@ let MAIN_TS = `/// <reference no-default-lib="true" />
/// <reference lib="dom.asynciterable" />
/// <reference lib="deno.ns" />
import "$std/dotenv/load.ts";
import { start } from "$fresh/server.ts";
import manifest from "./fresh.gen.ts";
import config from "./fresh.config.ts";
@@ -538,6 +540,8 @@ const DEV_TS = `#!/usr/bin/env -S deno run -A --watch=static/,routes/
import dev from "$fresh/dev.ts";
import config from "./fresh.config.ts";
import "$std/dotenv/load.ts";
await dev(import.meta.url, "./main.ts", config);
`;
const DEV_TS_PATH = join(resolvedDirectory, "dev.ts");
@@ -555,7 +559,7 @@ const config = {
"deno fmt --check && deno lint && deno check **/*.ts && deno check **/*.tsx",
cli: "echo \"import '\\$fresh/src/dev/cli.ts'\" | deno run --unstable -A -",
manifest: "deno task cli manifest $(pwd)",
start: "deno run -A --watch=static/,routes/ --env dev.ts",
start: "deno run -A --watch=static/,routes/ dev.ts",
build: "deno run -A dev.ts build",
preview: "deno run -A main.ts",
update: "deno run -A -r https://fresh.deno.dev/update .",