vite-plugin-kiru 0.32.0-preview.2 → 0.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build.dev.ts +3 -4
- package/dist/index.d.ts +26 -82
- package/dist/index.js +2689 -2282
- package/package.json +3 -15
- package/dist/server.d.ts +0 -43
- package/dist/server.js +0 -7019
package/build.dev.ts
CHANGED
|
@@ -3,13 +3,13 @@ import fs from "node:fs"
|
|
|
3
3
|
|
|
4
4
|
await esbuild
|
|
5
5
|
.context({
|
|
6
|
-
entryPoints: ["src/index.ts"
|
|
6
|
+
entryPoints: ["src/index.ts"],
|
|
7
7
|
bundle: true,
|
|
8
8
|
platform: "node",
|
|
9
9
|
target: "esnext",
|
|
10
10
|
format: "esm",
|
|
11
|
-
|
|
12
|
-
external: ["kiru", "vite"
|
|
11
|
+
outfile: "./dist/index.js",
|
|
12
|
+
external: ["kiru", "vite"],
|
|
13
13
|
write: true,
|
|
14
14
|
plugins: [
|
|
15
15
|
{
|
|
@@ -18,7 +18,6 @@ await esbuild
|
|
|
18
18
|
onEnd(() => {
|
|
19
19
|
console.log("[vite-plugin-kiru]: Build complete!")
|
|
20
20
|
fs.copyFileSync("./src/types.d.ts", "dist/index.d.ts")
|
|
21
|
-
fs.copyFileSync("./src/types.server.d.ts", "dist/server.d.ts")
|
|
22
21
|
})
|
|
23
22
|
},
|
|
24
23
|
},
|
package/dist/index.d.ts
CHANGED
|
@@ -116,11 +116,6 @@ export interface SSGOptions {
|
|
|
116
116
|
* @default "layout.{tsx,jsx}"
|
|
117
117
|
*/
|
|
118
118
|
layout?: string
|
|
119
|
-
/**
|
|
120
|
-
* The filename of guard files to search for
|
|
121
|
-
* @default "guard.{ts,js}"
|
|
122
|
-
*/
|
|
123
|
-
guard?: string
|
|
124
119
|
/**
|
|
125
120
|
* Enable transitions for all routes and loading states
|
|
126
121
|
* @default false
|
|
@@ -138,68 +133,6 @@ export interface SSGOptions {
|
|
|
138
133
|
build?: SSGBuildOptions
|
|
139
134
|
}
|
|
140
135
|
|
|
141
|
-
export interface SSROptions {
|
|
142
|
-
/**
|
|
143
|
-
* The path to the server entry file
|
|
144
|
-
* @example "src/server.ts"
|
|
145
|
-
*/
|
|
146
|
-
runtimeEntry: string
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* The secret to use for server function RPCs.
|
|
150
|
-
* If not specified, one will be generated automatically.
|
|
151
|
-
*/
|
|
152
|
-
secret?: string
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* The base URL of the app
|
|
156
|
-
* @default "/"
|
|
157
|
-
*/
|
|
158
|
-
baseUrl?: string
|
|
159
|
-
|
|
160
|
-
/**
|
|
161
|
-
* The directory of the app
|
|
162
|
-
* @default "src/pages"
|
|
163
|
-
*/
|
|
164
|
-
dir?: string
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* The name of the document component
|
|
168
|
-
* @default "document.{tsx,jsx}"
|
|
169
|
-
*/
|
|
170
|
-
document?: string
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* The filename of page components to search for
|
|
174
|
-
* @default "index.{tsx,jsx}"
|
|
175
|
-
*/
|
|
176
|
-
page?: string
|
|
177
|
-
|
|
178
|
-
/**
|
|
179
|
-
* The filename of 'remote' files for server function RPCs
|
|
180
|
-
* @default "remote.{ts,js}"
|
|
181
|
-
*/
|
|
182
|
-
remote?: string
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* The filename of layout components to search for
|
|
186
|
-
* @default "layout.{tsx,jsx}"
|
|
187
|
-
*/
|
|
188
|
-
layout?: string
|
|
189
|
-
|
|
190
|
-
/**
|
|
191
|
-
* The filename of guard files to search for
|
|
192
|
-
* @default "guard.{ts,js}"
|
|
193
|
-
*/
|
|
194
|
-
guard?: string
|
|
195
|
-
|
|
196
|
-
/**
|
|
197
|
-
* Enable transitions for all routes and loading states
|
|
198
|
-
* @default false
|
|
199
|
-
*/
|
|
200
|
-
transition?: boolean
|
|
201
|
-
}
|
|
202
|
-
|
|
203
136
|
export interface DevtoolsOptions {
|
|
204
137
|
/**
|
|
205
138
|
* Specifies the path to the devtools app displayed via popup
|
|
@@ -217,6 +150,27 @@ export interface DevtoolsOptions {
|
|
|
217
150
|
formatFileLink?: FileLinkFormatter
|
|
218
151
|
}
|
|
219
152
|
|
|
153
|
+
export interface ExperimentalOptions {
|
|
154
|
+
/**
|
|
155
|
+
* Enable static JSX hoisting optimization
|
|
156
|
+
* @default false
|
|
157
|
+
* @example
|
|
158
|
+
* ```tsx
|
|
159
|
+
* function MyComponent() {
|
|
160
|
+
* return <div>Hello, world!</div>
|
|
161
|
+
* }
|
|
162
|
+
* // becomes:
|
|
163
|
+
* const $k0 = createElement("div", null, "Hello, world!")
|
|
164
|
+
* function MyComponent() {
|
|
165
|
+
* return $k0
|
|
166
|
+
* }
|
|
167
|
+
* // because the JSX is static, it can be hoisted to the top of the component.
|
|
168
|
+
* // our 'div' with 'Hello, world!' is _never rerendered_.
|
|
169
|
+
* ```
|
|
170
|
+
*/
|
|
171
|
+
staticHoisting?: boolean
|
|
172
|
+
}
|
|
173
|
+
|
|
220
174
|
export interface KiruPluginOptions {
|
|
221
175
|
/**
|
|
222
176
|
* Whether the devtools should be injected into the build during development
|
|
@@ -247,25 +201,15 @@ export interface KiruPluginOptions {
|
|
|
247
201
|
onFileExcluded?: (id: string) => void
|
|
248
202
|
|
|
249
203
|
/**
|
|
250
|
-
*
|
|
251
|
-
* @example
|
|
252
|
-
* ```ts
|
|
253
|
-
* ssg: {
|
|
254
|
-
* dir: "./src/app",
|
|
255
|
-
* document: "document.{tsx,jsx}",
|
|
256
|
-
* page: "index.{tsx,jsx}",
|
|
257
|
-
* layout: "layout.{tsx,jsx}",
|
|
258
|
-
* transition: true
|
|
259
|
-
* }
|
|
260
|
-
* ```
|
|
204
|
+
* Experimental options
|
|
261
205
|
*/
|
|
262
|
-
|
|
206
|
+
experimental?: ExperimentalOptions
|
|
263
207
|
|
|
264
208
|
/**
|
|
265
|
-
* Options for
|
|
209
|
+
* Options for SSG
|
|
266
210
|
* @example
|
|
267
211
|
* ```ts
|
|
268
|
-
*
|
|
212
|
+
* ssg: {
|
|
269
213
|
* dir: "./src/app",
|
|
270
214
|
* document: "document.{tsx,jsx}",
|
|
271
215
|
* page: "index.{tsx,jsx}",
|
|
@@ -274,7 +218,7 @@ export interface KiruPluginOptions {
|
|
|
274
218
|
* }
|
|
275
219
|
* ```
|
|
276
220
|
*/
|
|
277
|
-
|
|
221
|
+
ssg?: SSGOptions | true
|
|
278
222
|
}
|
|
279
223
|
|
|
280
224
|
export const defaultEsBuildOptions: ESBuildOptions
|