MCPcopy
hub / github.com/freshframework/fresh / constructor

Method constructor

packages/fresh/src/dev/builder.ts:127–155  ·  view source on GitHub ↗
(options?: BuildOptions)

Source from the content-addressed store, hash-verified

125 #ready = Promise.withResolvers<void>();
126
127 constructor(options?: BuildOptions) {
128 const root = parseDirPath(options?.root ?? ".", Deno.cwd());
129 const serverEntry = parseDirPath(options?.serverEntry ?? "main.ts", root);
130 const outDir = parseDirPath(options?.outDir ?? "_fresh", root);
131 const rawStaticDir = options?.staticDir ?? "static";
132 const staticDir =
133 (Array.isArray(rawStaticDir) ? rawStaticDir : [rawStaticDir])
134 .map((d) => parseDirPath(d, root));
135 const islandDir = parseDirPath(options?.islandDir ?? "islands", root);
136 const routeDir = parseDirPath(options?.routeDir ?? "routes", root);
137
138 this.#fsRoutes = { dir: routeDir, files: [], id: "default" };
139
140 this.#transformer = new FileTransformer(fsAdapter, root);
141
142 this.config = {
143 serverEntry,
144 target: options?.target ?? ["chrome99", "firefox99", "safari15"],
145 root,
146 outDir,
147 staticDir,
148 islandDir,
149 routeDir,
150 ignore: options?.ignore ?? [TEST_FILE_PATTERN],
151 mode: "production",
152 buildId: BUILD_ID,
153 sourceMap: options?.sourceMap,
154 };
155 }
156
157 registerIsland(specifier: string): void {
158 this.#islandSpecifiers.add(specifier);

Callers

nothing calls this directly

Calls 2

parseDirPathFunction · 0.90
cwdMethod · 0.80

Tested by

no test coverage detected