Skip to content

Commit 192b9e9

Browse files
committed
fix: update build and asset hashing on create
1 parent 792c21c commit 192b9e9

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

create.ts

+14-6
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,15 @@ function resolveDialect(typescript: boolean) {
158158

159159
function denoConfigContent(utils: TaskUtils) {
160160
const serverEntrypoint = utils.dialectFilename("./server", true);
161+
const buildEntrypoint = utils.dialectFilename("./build", false);
162+
161163
// deno-fmt-ignore
162164
return outdent`
163165
{
164166
"tasks": {
165167
"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"
168170
},
169171
"compilerOptions": {
170172
"jsx": "react-jsxdev",
@@ -196,12 +198,15 @@ function buildContent(utils: TaskUtils) {
196198

197199
// deno-fmt-ignore
198200
return outdent`
199-
import build from "ultra/build.ts";
201+
import { createBuilder } from "ultra/build.ts";
200202
201-
await build({
203+
const builder = createBuilder({
202204
browserEntrypoint: import.meta.resolve("${browserEntrypoint}"),
203205
serverEntrypoint: import.meta.resolve("${serverEntrypoint}"),
204206
});
207+
208+
// deno-lint-ignore no-unused-vars
209+
const result = await builder.build();
205210
`;
206211
}
207212

@@ -295,6 +300,8 @@ function styleContent() {
295300
function helloUltraContent() {
296301
// deno-fmt-ignore
297302
return outdent`
303+
import useAsset from "ultra/hooks/use-asset.js";
304+
298305
export default function App() {
299306
console.log("Hello world!");
300307
return (
@@ -303,8 +310,9 @@ function helloUltraContent() {
303310
<meta charSet="utf-8" />
304311
<title>Ultra</title>
305312
<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")} />
308316
</head>
309317
<body>
310318
<main>

0 commit comments

Comments
 (0)