@@ -158,13 +158,15 @@ function resolveDialect(typescript: boolean) {
158
158
159
159
function denoConfigContent ( utils : TaskUtils ) {
160
160
const serverEntrypoint = utils . dialectFilename ( "./server" , true ) ;
161
+ const buildEntrypoint = utils . dialectFilename ( "./build" , false ) ;
162
+
161
163
// deno-fmt-ignore
162
164
return outdent `
163
165
{
164
166
"tasks": {
165
167
"dev": "deno run -A --no-check --watch ${ serverEntrypoint } ",
166
- "build": "deno run -A ./build.ts ",
167
- "start": "ULTRA_MODE=production deno run -A --no-remote ${ serverEntrypoint } "
168
+ "build": "deno run -A ${ buildEntrypoint } ",
169
+ "start": "ULTRA_MODE=production deno run -A --no-remote ./server.js "
168
170
},
169
171
"compilerOptions": {
170
172
"jsx": "react-jsxdev",
@@ -196,12 +198,15 @@ function buildContent(utils: TaskUtils) {
196
198
197
199
// deno-fmt-ignore
198
200
return outdent `
199
- import build from "ultra/build.ts";
201
+ import { createBuilder } from "ultra/build.ts";
200
202
201
- await build ({
203
+ const builder = createBuilder ({
202
204
browserEntrypoint: import.meta.resolve("${ browserEntrypoint } "),
203
205
serverEntrypoint: import.meta.resolve("${ serverEntrypoint } "),
204
206
});
207
+
208
+ // deno-lint-ignore no-unused-vars
209
+ const result = await builder.build();
205
210
` ;
206
211
}
207
212
@@ -295,6 +300,8 @@ function styleContent() {
295
300
function helloUltraContent ( ) {
296
301
// deno-fmt-ignore
297
302
return outdent `
303
+ import useAsset from "ultra/hooks/use-asset.js";
304
+
298
305
export default function App() {
299
306
console.log("Hello world!");
300
307
return (
@@ -303,8 +310,9 @@ function helloUltraContent() {
303
310
<meta charSet="utf-8" />
304
311
<title>Ultra</title>
305
312
<meta name="viewport" content="width=device-width, initial-scale=1" />
306
- <link rel="shortcut icon" href="/favicon.ico" />
307
- <link rel="stylesheet" href="/style.css" />
313
+ <link rel="shortcut icon" href={useAsset("./favicon.ico")} />
314
+ <link rel="preload" as="style" href={useAsset("./style.css")} />
315
+ <link rel="stylesheet" href={useAsset("./style.css")} />
308
316
</head>
309
317
<body>
310
318
<main>
0 commit comments