Skip to content

Commit be21dd0

Browse files
committed
BREAKING(core): move FreshConfig.build.outDir to FreshConfig.buildOutDir
1 parent 2b302ac commit be21dd0

2 files changed

Lines changed: 10 additions & 20 deletions

File tree

src/config.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@ import type { Mode } from "./runtime/server/mod.ts";
33

44
export interface FreshConfig {
55
root?: string;
6-
build?: {
7-
/**
8-
* The directory to write generated files to when `dev.ts build` is run.
9-
* This can be an absolute path, a file URL or a relative path.
10-
*/
11-
outDir?: string;
12-
};
6+
/**
7+
* The directory to write generated files to when `dev.ts build` is run.
8+
* This can be an absolute path, a file URL or a relative path.
9+
*/
10+
buildOutDir?: string;
1311
/**
1412
* Serve fresh from a base path instead of from the root.
1513
* "/foo/bar" -> http://localhost:8000/foo/bar
@@ -61,7 +59,7 @@ export function normalizeConfig(options: FreshConfig): ResolvedFreshConfig {
6159
return {
6260
root,
6361
build: {
64-
outDir: options.build?.outDir ?? path.join(root, "_fresh"),
62+
outDir: options.buildOutDir ?? path.join(root, "_fresh"),
6563
},
6664
basePath: options.basePath ?? "",
6765
staticDir: options.staticDir ?? path.join(root, "static"),

src/dev/builder_test.ts

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ Deno.test({
3333
await Deno.writeTextFile(path.join(tmp, "foo.css"), "body { color: red; }");
3434
const app = new App({
3535
staticDir: tmp,
36-
build: {
37-
outDir: path.join(tmp, "dist"),
38-
},
36+
buildOutDir: path.join(tmp, "dist"),
3937
});
4038
await builder.build(app);
4139

@@ -57,9 +55,7 @@ Deno.test({
5755
);
5856
const app = new App({
5957
staticDir: tmp,
60-
build: {
61-
outDir: path.join(tmp, "dist"),
62-
},
58+
buildOutDir: path.join(tmp, "dist"),
6359
});
6460
await builder.build(app);
6561

@@ -83,9 +79,7 @@ Deno.test({
8379
);
8480
const app = new App({
8581
staticDir: tmp,
86-
build: {
87-
outDir: path.join(tmp, "dist"),
88-
},
82+
buildOutDir: path.join(tmp, "dist"),
8983
});
9084
await builder.build(app);
9185

@@ -105,9 +99,7 @@ Deno.test({
10599
const tmp = await Deno.makeTempDir();
106100
const app = new App({
107101
staticDir: tmp,
108-
build: {
109-
outDir: path.join(tmp, "dist"),
110-
},
102+
buildOutDir: path.join(tmp, "dist"),
111103
});
112104

113105
app.island("jsr:@marvinh-test/fresh-island", "RemoteIsland", RemoteIsland);

0 commit comments

Comments
 (0)