File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,5 +5,8 @@ import deno from "@deno/astro-adapter";
55// https://astro.build/config
66export default defineConfig ( {
77 output : "server" ,
8+ server : {
9+ allowedHosts : [ "deploy-subcommand-testing--local.deno.deno.net" ] ,
10+ } ,
811 adapter : deno ( ) ,
912} ) ;
Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ import {
44 modify as modifyJSONC ,
55 parse as parseJSONC ,
66} from "jsonc-parser" ;
7- import { resolve_config_with_deploy_config } from "./lib/rs_lib.js" ;
7+ import {
8+ resolve_config ,
9+ resolve_config_with_deploy_config ,
10+ } from "./lib/rs_lib.js" ;
811
912export interface Config {
1013 path : string ;
@@ -20,6 +23,10 @@ export async function readConfig(
2023 return { path : maybeConfigPath , content } ;
2124 }
2225
26+ // we prefer the configs with the deploy key. then we fallback to a general
27+ // config, so when we set the values, it uses existing config files instead
28+ // of trying to create a new one (which will still happen if no config file is found)
29+
2330 const configUrl = resolve_config_with_deploy_config ( rootPath ) ;
2431
2532 if ( configUrl ) {
@@ -28,6 +35,14 @@ export async function readConfig(
2835 return { path, content } ;
2936 }
3037
38+ const configUrlWithoutDeployConfig = resolve_config ( rootPath ) ;
39+
40+ if ( configUrlWithoutDeployConfig ) {
41+ const path = fromFileUrl ( configUrlWithoutDeployConfig ) ;
42+ const content = await Deno . readTextFile ( path ) ;
43+ return { path, content } ;
44+ }
45+
3146 return null ;
3247}
3348
Original file line number Diff line number Diff line change 11{
2+ "nodeModulesDir" : " auto" ,
3+ "workspace" : [
4+ " astro-demo"
5+ ],
26 "name" : " @deno/deploy" ,
37 "license" : " MIT" ,
48 "tasks" : {
3135 "@deno/framework-detect" : " jsr:@deno/framework-detect@^0" ,
3236 "temporal-polyfill" : " npm:temporal-polyfill@^0.3.0"
3337 },
34- "exclude" : [" astro-demo" ]
38+ "exclude" : [
39+ " astro-demo"
40+ ]
3541}
You can’t perform that action at this time.
0 commit comments