feat: import fresh from fresh (#2479)

Instead of importing as `@fresh/core`.
This commit is contained in:
Luca Casonato
2024-06-05 14:51:35 +02:00
committed by GitHub
parent 19d3e452ac
commit c3ec742a65
39 changed files with 89 additions and 89 deletions
+5 -5
View File
@@ -21,7 +21,7 @@ deno run -Ar jsr:@fresh/update
This will apply most API changes made in Fresh 2
[automatically](#automatic-updates) like changing `$fresh/server.ts` imports to
`@fresh/core`.
`fresh`.
## Getting `main.ts` and `dev.ts` ready
@@ -51,7 +51,7 @@ plugins like [tailwindcss](https://tailwindcss.com/).
The full `dev.ts` file for newly generated Fresh 2 projects looks like this:
```ts
import { Builder } from "@fresh/core/dev";
import { Builder } from "fresh/dev";
import { tailwind } from "@fresh/plugin-tailwind";
import { app } from "./main.ts";
@@ -78,7 +78,7 @@ Similarly, configuration related to running Fresh in production can be passed to
```ts
// main.ts
import { App, fsRoutes, staticFiles } from "@fresh/core";
import { App, fsRoutes, staticFiles } from "fresh";
export const app = new App()
// Add static file serving middleware
@@ -178,8 +178,8 @@ you can add if needed. This middleware can be used to ensure that URLs always
have a trailing slash at the end or that they will never have one.
```diff
- import { App, staticFiles } from "@fresh/core";
+ import { App, staticFiles, trailingSlashes } from "@fresh/core";
- import { App, staticFiles } from "fresh";
+ import { App, staticFiles, trailingSlashes } from "fresh";
export const app = new App({ root: import.meta.url })
.use(staticFiles())