Skip to content

Commit 78cc3cd

Browse files
Version Packages (#221)
1 parent 65e2f76 commit 78cc3cd

File tree

3 files changed

+63
-62
lines changed

3 files changed

+63
-62
lines changed

.changeset/tall-teachers-carry.md

Lines changed: 0 additions & 61 deletions
This file was deleted.

packages/build/CHANGELOG.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,67 @@
11
# @hono/vite-build
22

3+
## 1.3.0
4+
5+
### Minor Changes
6+
7+
- [#218](https://github.com/honojs/vite-plugins/pull/218) [`65e2f768a26d0665aaa05f60abf36bb66a6b6fa9`](https://github.com/honojs/vite-plugins/commit/65e2f768a26d0665aaa05f60abf36bb66a6b6fa9) Thanks [@chadxz](https://github.com/chadxz)! - Added a new Netlify Functions build adapter.
8+
9+
This adapter can be imported from `@hono/vite-build/netlify-functions` and will
10+
compile your Hono app to comply with the requirements of the Netlify Functions
11+
runtime.
12+
13+
- The default export will have the `hono/netlify` adapter applied to it.
14+
- A `config` object will be exported, setting the function path to `'/*'` and
15+
`preferStatic` to `true`.
16+
17+
Please note, this is for the Netlify Functions runtime, not the Netlify Edge
18+
Functions runtime.
19+
20+
Example:
21+
22+
```ts
23+
// vite.config.ts
24+
import { defineConfig } from 'vite'
25+
import devServer from '@hono/vite-dev-server'
26+
import build from '@hono/vite-build/netlify-functions'
27+
28+
export default defineConfig({
29+
plugins: [
30+
devServer({
31+
entry: './src/index.ts',
32+
}),
33+
build({
34+
entry: './src/index.ts',
35+
output: 'functions/server/index.js',
36+
}),
37+
],
38+
})
39+
```
40+
41+
If you also have a `public/publish` directory for your assets that should be
42+
published to the corresponding Netlify site, then after running a build, you
43+
would end up with a directory structure like:
44+
45+
```
46+
dist/
47+
functions/
48+
server/
49+
index.js
50+
publish/
51+
robots.txt
52+
....
53+
```
54+
55+
then you can use a netlify.toml that looks like:
56+
57+
```toml
58+
# https://ntl.fyi/file-based-build-config
59+
[build]
60+
command = "vite build"
61+
functions = "dist/functions"
62+
publish = "dist/publish"
63+
```
64+
365
## 1.2.1
466

567
### Patch Changes

packages/build/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@hono/vite-build",
33
"description": "Vite plugin to build your Hono app",
4-
"version": "1.2.1",
4+
"version": "1.3.0",
55
"types": "dist/index.d.ts",
66
"module": "dist/index.js",
77
"type": "module",

0 commit comments

Comments
 (0)