revojs 0.1.45 → 0.1.46
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/dist/{app-B4HJTrxE.mjs → app-DqEq3uwt.mjs} +3 -6
- package/dist/commands/index.mjs +1 -1
- package/dist/{index--5m6SUpo.d.mts → index-BaqVUbna.d.mts} +18 -20
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +1 -1
- package/dist/kit/index.d.mts +2 -3
- package/dist/kit/index.mjs +3 -6
- package/dist/{package-9EF2Bhnr.mjs → package-CHq5U5yh.mjs} +1 -1
- package/dist/vite/index.d.mts +3 -3
- package/dist/vite/index.mjs +19 -21
- package/package.json +1 -1
|
@@ -608,12 +608,9 @@ var App = class extends Hookable {
|
|
|
608
608
|
},
|
|
609
609
|
variables: {},
|
|
610
610
|
development: { middleware: [] },
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
virtuals: {},
|
|
615
|
-
alias: {}
|
|
616
|
-
}
|
|
611
|
+
templates: {},
|
|
612
|
+
virtuals: {},
|
|
613
|
+
vite: {}
|
|
617
614
|
});
|
|
618
615
|
}
|
|
619
616
|
};
|
package/dist/commands/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { n as version, t as name } from "../package-
|
|
2
|
+
import { n as version, t as name } from "../package-CHq5U5yh.mjs";
|
|
3
3
|
import { defineCommand, runMain } from "citty";
|
|
4
4
|
//#region src/commands/run/index.ts
|
|
5
5
|
var run_default = defineCommand({ setup() {} });
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { UserConfig } from "vite";
|
|
2
|
+
|
|
1
3
|
//#region src/shared/index.d.ts
|
|
2
4
|
type Descriptor<T> = string & {
|
|
3
5
|
[descriptor]: T;
|
|
@@ -7,7 +9,8 @@ type Context = Record<string, any>;
|
|
|
7
9
|
type Output<T> = Success<T> | Failure;
|
|
8
10
|
type InferInput<T extends Schema> = NonNullable<T["~standard"]["types"]>["input"];
|
|
9
11
|
type InferOutput<T extends Schema> = NonNullable<T["~standard"]["types"]>["output"];
|
|
10
|
-
type
|
|
12
|
+
type Primitive = string | number | boolean | bigint | symbol | null | undefined;
|
|
13
|
+
type Mergeable<T> = T extends Primitive ? T : T extends Array<infer U> ? Array<Mergeable<U>> : { [K in keyof T]?: Mergeable<T[K]> };
|
|
11
14
|
interface Issue {
|
|
12
15
|
readonly message: string;
|
|
13
16
|
}
|
|
@@ -93,6 +96,11 @@ interface Server {
|
|
|
93
96
|
middleware: Array<Middleware>;
|
|
94
97
|
fetch: (scope: Scope) => Result;
|
|
95
98
|
}
|
|
99
|
+
interface PathNode<T> {
|
|
100
|
+
type: "PATH";
|
|
101
|
+
value?: T;
|
|
102
|
+
children: Record<string, Node<T>>;
|
|
103
|
+
}
|
|
96
104
|
interface WildcardNode<T> {
|
|
97
105
|
type: "WILDCARD";
|
|
98
106
|
value?: T;
|
|
@@ -105,21 +113,16 @@ interface OptionalWildcardNode<T> {
|
|
|
105
113
|
parameter: string;
|
|
106
114
|
children: Record<string, Node<T>>;
|
|
107
115
|
}
|
|
108
|
-
interface OptionalParameterNode<T> {
|
|
109
|
-
type: "OPTIONAL-PARAMETER";
|
|
110
|
-
value?: T;
|
|
111
|
-
parameter: string;
|
|
112
|
-
children: Record<string, Node<T>>;
|
|
113
|
-
}
|
|
114
116
|
interface ParameterNode<T> {
|
|
115
117
|
type: "PARAMETER";
|
|
116
118
|
value?: T;
|
|
117
119
|
parameter: string;
|
|
118
120
|
children: Record<string, Node<T>>;
|
|
119
121
|
}
|
|
120
|
-
interface
|
|
121
|
-
type: "
|
|
122
|
+
interface OptionalParameterNode<T> {
|
|
123
|
+
type: "OPTIONAL-PARAMETER";
|
|
122
124
|
value?: T;
|
|
125
|
+
parameter: string;
|
|
123
126
|
children: Record<string, Node<T>>;
|
|
124
127
|
}
|
|
125
128
|
declare class Radix<T> {
|
|
@@ -187,7 +190,7 @@ declare const mimeTypes: Record<string, string>;
|
|
|
187
190
|
//#region src/app/index.d.ts
|
|
188
191
|
type Environment = typeof CLIENT | typeof SERVER;
|
|
189
192
|
type Virtual = (environment: Environment) => undefined | string | Promise<string>;
|
|
190
|
-
type Content = () => string
|
|
193
|
+
type Content = () => string | Promise<string>;
|
|
191
194
|
interface Template {
|
|
192
195
|
tagName: string;
|
|
193
196
|
attributes: Record<string, string>;
|
|
@@ -196,12 +199,6 @@ interface Template {
|
|
|
196
199
|
interface DevelopmentConfig {
|
|
197
200
|
middleware: Array<Middleware>;
|
|
198
201
|
}
|
|
199
|
-
interface BuildConfig {
|
|
200
|
-
externals: Array<string>;
|
|
201
|
-
templates: Record<string, Content>;
|
|
202
|
-
virtuals: Record<string, Virtual>;
|
|
203
|
-
alias: Record<string, string>;
|
|
204
|
-
}
|
|
205
202
|
interface Config {
|
|
206
203
|
modules: Array<Module>;
|
|
207
204
|
client?: string;
|
|
@@ -210,11 +207,12 @@ interface Config {
|
|
|
210
207
|
sources: Record<string, Source>;
|
|
211
208
|
variables: Record<string, unknown>;
|
|
212
209
|
development: DevelopmentConfig;
|
|
213
|
-
|
|
210
|
+
templates: Record<string, Content>;
|
|
211
|
+
virtuals: Record<string, Virtual>;
|
|
212
|
+
vite: UserConfig;
|
|
214
213
|
}
|
|
215
214
|
interface Module {
|
|
216
|
-
|
|
217
|
-
setup?: (app: App) => void | Promise<void>;
|
|
215
|
+
setup?: (app: App) => void | Mergeable<Config> | Promise<void | Mergeable<Config>>;
|
|
218
216
|
}
|
|
219
217
|
interface Source {
|
|
220
218
|
match: string | Array<string>;
|
|
@@ -232,4 +230,4 @@ declare const CLOSE_HOOK: Descriptor<() => void>;
|
|
|
232
230
|
//#region src/client/index.d.ts
|
|
233
231
|
declare function $fetch<T>(scope: Scope, input: string | URL, options?: RequestInit): Promise<T>;
|
|
234
232
|
//#endregion
|
|
235
|
-
export {
|
|
233
|
+
export { encodings as $, ParameterNode as A, Context as At, STATES as B, Primitive as Bt, OPTIONAL_PARAMETER_MATCH as C, useParameters as Ct, OptionalWildcardNode as D, useSetCookies as Dt, OptionalParameterNode as E, useServer as Et, Result as F, InferOutput as Ft, WILDCARD as G, defineHook as Gt, ServerContext as H, Scope as Ht, Route as I, Invoke as It, cookiePriorities as J, parseSchema as Jt, WILDCARD_MATCH as K, isFailure as Kt, Router as L, Issue as Lt, ROUTER_CONTEXT as M, Failure as Mt, Radix as N, Hookable as Nt, PARAMETER as O, useUrl as Ot, ResponseConfig as P, InferInput as Pt, defineRoute as Q, RouterContext as R, Mergeable as Rt, OPTIONAL_PARAMETER as S, useHeaders as St, OPTIONAL_WILDCARD_MATCH as T, useRouter as Tt, States as U, Success as Ut, Server as V, Schema as Vt, StatusCode as W, defineContext as Wt, createServer as X, cookieSameSites as Y, defineMiddleware as Z, Encoding as _, setCookie as _t, Config as a, mimeType as at, MimeType as b, useBody as bt, Environment as c, sendBadRequest as ct, Source as d, sendNoContent as dt, getState as et, Template as f, sendNotFound as ft, CookieSameSite as g, sendUnauthorized as gt, CookiePriority as h, sendResponse as ht, CLOSE_HOOK as i, isServer as it, PathNode as j, Descriptor as jt, PARAMETER_MATCH as k, withQuery as kt, Module as l, sendCreated as lt, CookieOptions as m, sendRedirect as mt, App as n, invoke as nt, Content as o, mimeTypes as ot, Virtual as p, sendOk as pt, WildcardNode as q, mergeObjects as qt, CLIENT as r, isClient as rt, DevelopmentConfig as s, parseCookiePair as st, $fetch as t, httpMethods as tt, SERVER as u, sendForbidden as ut, HttpMethod as v, setState as vt, OPTIONAL_WILDCARD as w, useQuery as wt, Node as x, useCookies as xt, Middleware as y, statusCodes as yt, SERVER_CONTEXT as z, Output as zt };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
export { $fetch, App,
|
|
1
|
+
import { $ as encodings, A as ParameterNode, At as Context, B as STATES, Bt as Primitive, C as OPTIONAL_PARAMETER_MATCH, Ct as useParameters, D as OptionalWildcardNode, Dt as useSetCookies, E as OptionalParameterNode, Et as useServer, F as Result, Ft as InferOutput, G as WILDCARD, Gt as defineHook, H as ServerContext, Ht as Scope, I as Route, It as Invoke, J as cookiePriorities, Jt as parseSchema, K as WILDCARD_MATCH, Kt as isFailure, L as Router, Lt as Issue, M as ROUTER_CONTEXT, Mt as Failure, N as Radix, Nt as Hookable, O as PARAMETER, Ot as useUrl, P as ResponseConfig, Pt as InferInput, Q as defineRoute, R as RouterContext, Rt as Mergeable, S as OPTIONAL_PARAMETER, St as useHeaders, T as OPTIONAL_WILDCARD_MATCH, Tt as useRouter, U as States, Ut as Success, V as Server, Vt as Schema, W as StatusCode, Wt as defineContext, X as createServer, Y as cookieSameSites, Z as defineMiddleware, _ as Encoding, _t as setCookie, a as Config, at as mimeType, b as MimeType, bt as useBody, c as Environment, ct as sendBadRequest, d as Source, dt as sendNoContent, et as getState, f as Template, ft as sendNotFound, g as CookieSameSite, gt as sendUnauthorized, h as CookiePriority, ht as sendResponse, i as CLOSE_HOOK, it as isServer, j as PathNode, jt as Descriptor, k as PARAMETER_MATCH, kt as withQuery, l as Module, lt as sendCreated, m as CookieOptions, mt as sendRedirect, n as App, nt as invoke, o as Content, ot as mimeTypes, p as Virtual, pt as sendOk, q as WildcardNode, qt as mergeObjects, r as CLIENT, rt as isClient, s as DevelopmentConfig, st as parseCookiePair, t as $fetch, tt as httpMethods, u as SERVER, ut as sendForbidden, v as HttpMethod, vt as setState, w as OPTIONAL_WILDCARD, wt as useQuery, x as Node, xt as useCookies, y as Middleware, yt as statusCodes, z as SERVER_CONTEXT, zt as Output } from "./index-BaqVUbna.mjs";
|
|
2
|
+
export { $fetch, App, CLIENT, CLOSE_HOOK, Config, Content, Context, CookieOptions, CookiePriority, CookieSameSite, Descriptor, DevelopmentConfig, Encoding, Environment, Failure, Hookable, HttpMethod, InferInput, InferOutput, Invoke, Issue, Mergeable, Middleware, MimeType, Module, Node, OPTIONAL_PARAMETER, OPTIONAL_PARAMETER_MATCH, OPTIONAL_WILDCARD, OPTIONAL_WILDCARD_MATCH, OptionalParameterNode, OptionalWildcardNode, Output, PARAMETER, PARAMETER_MATCH, ParameterNode, PathNode, Primitive, ROUTER_CONTEXT, Radix, ResponseConfig, Result, Route, Router, RouterContext, SERVER, SERVER_CONTEXT, STATES, Schema, Scope, Server, ServerContext, Source, States, StatusCode, Success, Template, Virtual, WILDCARD, WILDCARD_MATCH, WildcardNode, cookiePriorities, cookieSameSites, createServer, defineContext, defineHook, defineMiddleware, defineRoute, encodings, getState, httpMethods, invoke, isClient, isFailure, isServer, mergeObjects, mimeType, mimeTypes, parseCookiePair, parseSchema, sendBadRequest, sendCreated, sendForbidden, sendNoContent, sendNotFound, sendOk, sendRedirect, sendResponse, sendUnauthorized, setCookie, setState, statusCodes, useBody, useCookies, useHeaders, useParameters, useQuery, useRouter, useServer, useSetCookies, useUrl, withQuery };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as useHeaders, A as encodings, B as sendCreated, C as WILDCARD, D as createServer, E as cookieSameSites, F as isServer, G as sendRedirect, H as sendNoContent, I as mimeType, J as setCookie, K as sendResponse, L as mimeTypes, M as httpMethods, N as invoke, O as defineMiddleware, P as isClient, Q as useCookies, R as parseCookiePair, S as STATES, T as cookiePriorities, U as sendNotFound, V as sendForbidden, W as sendOk, X as statusCodes, Y as setState, Z as useBody, _ as PARAMETER_MATCH, a as Hookable, at as useUrl, b as Router, c as defineHook, d as parseSchema, et as useParameters, f as OPTIONAL_PARAMETER, g as PARAMETER, h as OPTIONAL_WILDCARD_MATCH, i as SERVER, it as useSetCookies, j as getState, k as defineRoute, l as isFailure, m as OPTIONAL_WILDCARD, n as CLIENT, nt as useRouter, o as Scope, ot as withQuery, p as OPTIONAL_PARAMETER_MATCH, q as sendUnauthorized, r as CLOSE_HOOK, rt as useServer, s as defineContext, t as App, tt as useQuery, u as mergeObjects, v as ROUTER_CONTEXT, w as WILDCARD_MATCH, x as SERVER_CONTEXT, y as Radix, z as sendBadRequest } from "./app-
|
|
1
|
+
import { $ as useHeaders, A as encodings, B as sendCreated, C as WILDCARD, D as createServer, E as cookieSameSites, F as isServer, G as sendRedirect, H as sendNoContent, I as mimeType, J as setCookie, K as sendResponse, L as mimeTypes, M as httpMethods, N as invoke, O as defineMiddleware, P as isClient, Q as useCookies, R as parseCookiePair, S as STATES, T as cookiePriorities, U as sendNotFound, V as sendForbidden, W as sendOk, X as statusCodes, Y as setState, Z as useBody, _ as PARAMETER_MATCH, a as Hookable, at as useUrl, b as Router, c as defineHook, d as parseSchema, et as useParameters, f as OPTIONAL_PARAMETER, g as PARAMETER, h as OPTIONAL_WILDCARD_MATCH, i as SERVER, it as useSetCookies, j as getState, k as defineRoute, l as isFailure, m as OPTIONAL_WILDCARD, n as CLIENT, nt as useRouter, o as Scope, ot as withQuery, p as OPTIONAL_PARAMETER_MATCH, q as sendUnauthorized, r as CLOSE_HOOK, rt as useServer, s as defineContext, t as App, tt as useQuery, u as mergeObjects, v as ROUTER_CONTEXT, w as WILDCARD_MATCH, x as SERVER_CONTEXT, y as Radix, z as sendBadRequest } from "./app-DqEq3uwt.mjs";
|
|
2
2
|
//#region src/client/index.ts
|
|
3
3
|
async function $fetch(scope, input, options) {
|
|
4
4
|
let response;
|
package/dist/kit/index.d.mts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as App, o as Content, p as Virtual } from "../index-BaqVUbna.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/kit/index.d.ts
|
|
4
4
|
declare function useKit(source: string | URL): {
|
|
5
5
|
fromModule(...paths: Array<string>): string;
|
|
6
6
|
};
|
|
7
|
-
declare function addAlias(app: App, name: string, path: string): void;
|
|
8
7
|
declare function addTemplate(app: App, name: string, content: Content): void;
|
|
9
8
|
declare function addVirtual(app: App, name: string, virtual: Virtual): void;
|
|
10
9
|
declare function addRoutes(app: App, path: string): void;
|
|
11
10
|
declare function addMiddleware(app: App, path: string): void;
|
|
12
11
|
declare function addTypes(app: App, name: string, content: Content): void;
|
|
13
12
|
//#endregion
|
|
14
|
-
export {
|
|
13
|
+
export { addMiddleware, addRoutes, addTemplate, addTypes, addVirtual, useKit };
|
package/dist/kit/index.mjs
CHANGED
|
@@ -8,14 +8,11 @@ function useKit(source) {
|
|
|
8
8
|
return join(source, ...paths).split(win32.sep).join(posix.sep);
|
|
9
9
|
} };
|
|
10
10
|
}
|
|
11
|
-
function addAlias(app, name, path) {
|
|
12
|
-
app.config.build.alias["#alias/" + name] = path;
|
|
13
|
-
}
|
|
14
11
|
function addTemplate(app, name, content) {
|
|
15
|
-
app.config.
|
|
12
|
+
app.config.templates[name] = content;
|
|
16
13
|
}
|
|
17
14
|
function addVirtual(app, name, virtual) {
|
|
18
|
-
app.config.
|
|
15
|
+
app.config.virtuals["#" + name] = virtual;
|
|
19
16
|
}
|
|
20
17
|
function addRoutes(app, path) {
|
|
21
18
|
app.config.sources.routes?.entries.push(path);
|
|
@@ -27,4 +24,4 @@ function addTypes(app, name, content) {
|
|
|
27
24
|
addTemplate(app, `types/${name}.d.ts`, content);
|
|
28
25
|
}
|
|
29
26
|
//#endregion
|
|
30
|
-
export {
|
|
27
|
+
export { addMiddleware, addRoutes, addTemplate, addTypes, addVirtual, useKit };
|
package/dist/vite/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Rt as Mergeable, a as Config } from "../index-BaqVUbna.mjs";
|
|
2
|
+
import { PluginOption } from "vite";
|
|
3
3
|
|
|
4
4
|
//#region src/vite/index.d.ts
|
|
5
5
|
interface Import {
|
|
@@ -8,6 +8,6 @@ interface Import {
|
|
|
8
8
|
path: string;
|
|
9
9
|
}
|
|
10
10
|
declare function toImportName(path: string): string;
|
|
11
|
-
declare function revojs(config?: Mergeable<Config>): Array<
|
|
11
|
+
declare function revojs(config?: Mergeable<Config>): Promise<Array<PluginOption>>;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { Import, revojs, toImportName };
|
package/dist/vite/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { N as invoke, n as CLIENT, o as Scope, r as CLOSE_HOOK, t as App, u as mergeObjects, x as SERVER_CONTEXT } from "../app-
|
|
2
|
-
import { n as version, t as name } from "../package-
|
|
1
|
+
import { N as invoke, n as CLIENT, o as Scope, r as CLOSE_HOOK, t as App, u as mergeObjects, x as SERVER_CONTEXT } from "../app-DqEq3uwt.mjs";
|
|
2
|
+
import { n as version, t as name } from "../package-CHq5U5yh.mjs";
|
|
3
3
|
import { addTemplate, addTypes, addVirtual, useKit } from "../kit/index.mjs";
|
|
4
4
|
import { basename, dirname, isAbsolute, join, posix, resolve, win32 } from "path";
|
|
5
5
|
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
6
6
|
import { cwd } from "process";
|
|
7
7
|
import { globSync } from "tinyglobby";
|
|
8
|
-
import { isRunnableDevEnvironment } from "vite";
|
|
8
|
+
import { isRunnableDevEnvironment, mergeConfig } from "vite";
|
|
9
9
|
import { once } from "events";
|
|
10
10
|
import { Readable } from "stream";
|
|
11
11
|
//#region src/vite/node/index.ts
|
|
@@ -141,8 +141,12 @@ function toHtmlTagDescriptor(template, injectTo) {
|
|
|
141
141
|
function toImportName(path) {
|
|
142
142
|
return path.replace(/\.[^/.]+$/, "").replace(/\[\[\.\.\.(.*?)\]\]/g, "$1").replace(/\[\.\.\.(.*?)\]/g, "$1").replace(/\[\[(.*?)\]\]/g, "$1").replace(/\[(.*?)\]/g, "$1").split("/").flatMap((segment) => segment.split(/[-_]/g)).filter(Boolean).map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1)).join("").replace(/[^a-zA-Z0-9_$]/g, "");
|
|
143
143
|
}
|
|
144
|
-
function revojs(config) {
|
|
144
|
+
async function revojs(config) {
|
|
145
145
|
const app = new App(config);
|
|
146
|
+
for (const module of app.config.modules) {
|
|
147
|
+
const result = await module.setup?.(app);
|
|
148
|
+
if (typeof result === "object") app.config = mergeObjects(app.config, result);
|
|
149
|
+
}
|
|
146
150
|
return [
|
|
147
151
|
{
|
|
148
152
|
name,
|
|
@@ -151,8 +155,6 @@ function revojs(config) {
|
|
|
151
155
|
api: { [name]: app },
|
|
152
156
|
async config() {
|
|
153
157
|
const { fromModule } = useKit(cwd());
|
|
154
|
-
for (const module of app.config.modules) app.config = mergeObjects(app.config, await module.config?.());
|
|
155
|
-
for (const module of app.config.modules) await module.setup?.(app);
|
|
156
158
|
addVirtual(app, "client", () => {
|
|
157
159
|
if (app.config.client) return `import client from "${fromModule(app.config.client)}?client"; export default client`;
|
|
158
160
|
});
|
|
@@ -178,15 +180,15 @@ function revojs(config) {
|
|
|
178
180
|
return content;
|
|
179
181
|
});
|
|
180
182
|
addTypes(app, name, () => {
|
|
181
|
-
let content = entries.reduce((content, entry) => content
|
|
183
|
+
let content = entries.reduce((content, entry) => content += `export declare const ${entry.import}: typeof import("${entry.path}") extends { default: infer D } ? D : typeof import("${entry.path}") \n`, "");
|
|
182
184
|
content += `declare const entries: { ${entries.map((entry) => `"${entry.name}": typeof ${entry.import}`)} } \n`;
|
|
183
185
|
content += `export default entries`;
|
|
184
|
-
return content
|
|
186
|
+
return `declare module "#${name}" { ${content} }`;
|
|
185
187
|
});
|
|
186
188
|
}
|
|
187
189
|
const meta = resolve(".revojs");
|
|
188
190
|
addTemplate(app, "index.d.ts", () => {
|
|
189
|
-
return Object.keys(app.config.
|
|
191
|
+
return Object.keys(app.config.templates).reduce((content, name) => {
|
|
190
192
|
if (name.startsWith("types/")) content += `import "./${name}" \n`;
|
|
191
193
|
return content;
|
|
192
194
|
}, "");
|
|
@@ -195,20 +197,15 @@ function revojs(config) {
|
|
|
195
197
|
recursive: true,
|
|
196
198
|
force: true
|
|
197
199
|
});
|
|
198
|
-
for (const template in app.config.
|
|
200
|
+
for (const template in app.config.templates) {
|
|
199
201
|
const path = join(meta, template);
|
|
200
202
|
mkdirSync(dirname(path), { recursive: true });
|
|
201
|
-
writeFileSync(path, app.config.
|
|
203
|
+
writeFileSync(path, await app.config.templates[template]());
|
|
202
204
|
}
|
|
203
|
-
return {
|
|
205
|
+
return mergeConfig({
|
|
204
206
|
appType: "custom",
|
|
205
207
|
optimizeDeps: { exclude: ["revojs"] },
|
|
206
|
-
|
|
207
|
-
build: {
|
|
208
|
-
emptyOutDir: false,
|
|
209
|
-
assetsInlineLimit: 4096 * 4,
|
|
210
|
-
rolldownOptions: { external: app.config.build.externals }
|
|
211
|
-
},
|
|
208
|
+
build: { emptyOutDir: false },
|
|
212
209
|
define: Object.entries(app.config.variables).reduce((variables, [name, value]) => ({
|
|
213
210
|
...variables,
|
|
214
211
|
[`import.meta.${name}`]: value
|
|
@@ -259,7 +256,7 @@ function revojs(config) {
|
|
|
259
256
|
}
|
|
260
257
|
} }
|
|
261
258
|
}
|
|
262
|
-
};
|
|
259
|
+
}, app.config.vite);
|
|
263
260
|
},
|
|
264
261
|
transformIndexHtml: {
|
|
265
262
|
order: "pre",
|
|
@@ -301,8 +298,9 @@ function revojs(config) {
|
|
|
301
298
|
}
|
|
302
299
|
}
|
|
303
300
|
},
|
|
304
|
-
virtuals(app.config.
|
|
305
|
-
client()
|
|
301
|
+
virtuals(app.config.virtuals),
|
|
302
|
+
client(),
|
|
303
|
+
app.config.vite.plugins
|
|
306
304
|
];
|
|
307
305
|
}
|
|
308
306
|
//#endregion
|