@adonisjs/inertia 1.0.0-2 → 1.0.0-22

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.
Files changed (49) hide show
  1. package/build/app.css.stub +39 -0
  2. package/build/chunk-PJEYAPJB.js +254 -0
  3. package/build/{stubs/config.stub → config.stub} +10 -2
  4. package/build/index.d.ts +3 -2
  5. package/build/index.js +214 -36
  6. package/build/providers/inertia_provider.d.ts +14 -1
  7. package/build/providers/inertia_provider.js +29 -16
  8. package/build/react/app.tsx.stub +35 -0
  9. package/build/react/errors/not_found.tsx.stub +14 -0
  10. package/build/react/errors/server_error.tsx.stub +14 -0
  11. package/build/react/home.tsx.stub +21 -0
  12. package/build/react/root.edge.stub +22 -0
  13. package/build/react/ssr.tsx.stub +17 -0
  14. package/build/react/tsconfig.json.stub +15 -0
  15. package/build/solid/app.tsx.stub +35 -0
  16. package/build/solid/errors/not_found.tsx.stub +14 -0
  17. package/build/solid/errors/server_error.tsx.stub +14 -0
  18. package/build/solid/home.tsx.stub +18 -0
  19. package/build/solid/root.edge.stub +21 -0
  20. package/build/solid/ssr.tsx.stub +19 -0
  21. package/build/solid/tsconfig.json.stub +16 -0
  22. package/build/src/helpers.d.ts +12 -0
  23. package/build/src/helpers.js +14 -0
  24. package/build/src/inertia_middleware.d.ts +13 -9
  25. package/build/src/inertia_middleware.js +1 -1
  26. package/build/src/plugins/edge/plugin.js +85 -0
  27. package/build/src/plugins/{api_client.d.ts → japa/api_client.d.ts} +2 -1
  28. package/build/src/plugins/{api_client.js → japa/api_client.js} +1 -1
  29. package/build/src/plugins/vite.d.ts +26 -0
  30. package/build/src/plugins/vite.js +36 -0
  31. package/build/src/types.d.ts +61 -2
  32. package/build/svelte/app.ts.stub +30 -0
  33. package/build/svelte/errors/not_found.svelte.stub +10 -0
  34. package/build/svelte/errors/server_error.svelte.stub +14 -0
  35. package/build/svelte/home.svelte.stub +19 -0
  36. package/build/svelte/root.edge.stub +21 -0
  37. package/build/svelte/ssr.ts.stub +15 -0
  38. package/build/svelte/tsconfig.json.stub +14 -0
  39. package/build/vue/app.ts.stub +38 -0
  40. package/build/vue/errors/not_found.vue.stub +10 -0
  41. package/build/vue/errors/server_error.vue.stub +14 -0
  42. package/build/vue/home.vue.stub +21 -0
  43. package/build/vue/root.edge.stub +21 -0
  44. package/build/vue/ssr.ts.stub +22 -0
  45. package/build/vue/tsconfig.json.stub +16 -0
  46. package/package.json +52 -43
  47. package/build/chunk-GDULL3NT.js +0 -123
  48. package/build/src/plugins/edge.js +0 -41
  49. /package/build/src/plugins/{edge.d.ts → edge/plugin.d.ts} +0 -0
@@ -1,9 +1,10 @@
1
1
  import {
2
2
  InertiaMiddleware
3
- } from "../chunk-GDULL3NT.js";
3
+ } from "../chunk-PJEYAPJB.js";
4
4
 
5
5
  // providers/inertia_provider.ts
6
6
  import { configProvider } from "@adonisjs/core";
7
+ import { BriskRoute } from "@adonisjs/core/http";
7
8
  import { RuntimeException } from "@poppinss/utils";
8
9
  var InertiaProvider = class {
9
10
  constructor(app) {
@@ -13,26 +14,38 @@ var InertiaProvider = class {
13
14
  * Registers edge plugin when edge is installed
14
15
  */
15
16
  async registerEdgePlugin() {
16
- try {
17
- const edgeExports = await import("edge.js");
18
- const { edgePluginInertia } = await import("../src/plugins/edge.js");
19
- edgeExports.default.use(edgePluginInertia());
20
- } catch {
21
- }
17
+ if (!this.app.usingEdgeJS)
18
+ return;
19
+ const edgeExports = await import("edge.js");
20
+ const { edgePluginInertia } = await import("../src/plugins/edge/plugin.js");
21
+ edgeExports.default.use(edgePluginInertia());
22
22
  }
23
23
  /**
24
- * Register Inertia bindings
24
+ * Register inertia middleware
25
25
  */
26
26
  async register() {
27
- const inertiaConfigProvider = this.app.config.get("inertia");
28
- const config = await configProvider.resolve(this.app, inertiaConfigProvider);
29
- if (!config) {
30
- throw new RuntimeException(
31
- 'Invalid "config/inertia.ts" file. Make sure you are using the "defineConfig" method'
32
- );
33
- }
34
- this.app.container.singleton(InertiaMiddleware, () => new InertiaMiddleware(config));
27
+ this.app.container.singleton(InertiaMiddleware, async () => {
28
+ const inertiaConfigProvider = this.app.config.get("inertia");
29
+ const config = await configProvider.resolve(this.app, inertiaConfigProvider);
30
+ const vite = await this.app.container.make("vite");
31
+ if (!config) {
32
+ throw new RuntimeException(
33
+ 'Invalid "config/inertia.ts" file. Make sure you are using the "defineConfig" method'
34
+ );
35
+ }
36
+ return new InertiaMiddleware(config, vite);
37
+ });
38
+ }
39
+ /**
40
+ * Register edge plugin and brisk route macro
41
+ */
42
+ async boot() {
35
43
  await this.registerEdgePlugin();
44
+ BriskRoute.macro("renderInertia", function(template, props, viewProps) {
45
+ return this.setHandler(({ inertia }) => {
46
+ return inertia.render(template, props, viewProps);
47
+ });
48
+ });
36
49
  }
37
50
  };
38
51
  export {
@@ -0,0 +1,35 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/app/app.tsx') })
3
+ }}}
4
+ import '../css/app.css';
5
+
6
+ {{#if ssr}}
7
+ import { hydrateRoot } from 'react-dom/client'
8
+ {{#else}}
9
+ import { createRoot } from 'react-dom/client';
10
+ {{/if}}
11
+ import { createInertiaApp } from '@inertiajs/react';
12
+ import { resolvePageComponent } from '@adonisjs/inertia/helpers'
13
+
14
+ const appName = import.meta.env.VITE_APP_NAME || 'AdonisJS'
15
+
16
+ createInertiaApp({
17
+ progress: { color: '#5468FF' },
18
+
19
+ title: (title) => {{ '`${title} - ${appName}`' }},
20
+
21
+ resolve: (name) => {
22
+ return resolvePageComponent(
23
+ {{ '`../pages/${name}.tsx`' }},
24
+ import.meta.glob('../pages/**/*.tsx'),
25
+ )
26
+ },
27
+
28
+ setup({ el, App, props }) {
29
+ {{#if ssr}}
30
+ hydrateRoot(el, <App {...props} />)
31
+ {{#else}}
32
+ createRoot(el).render(<App {...props} />);
33
+ {{/if}}
34
+ },
35
+ });
@@ -0,0 +1,14 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/pages/errors/not_found.tsx') })
3
+ }}}
4
+ export default function NotFound() {
5
+ return (
6
+ <>
7
+ <div className="container">
8
+ <div className="title">Page not found</div>
9
+
10
+ <span>This page does not exist.</span>
11
+ </div>
12
+ </>
13
+ )
14
+ }
@@ -0,0 +1,14 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/pages/errors/server_error.tsx') })
3
+ }}}
4
+ export default function ServerError(props: { error: any }) {
5
+ return (
6
+ <>
7
+ <div className="container">
8
+ <div className="title">Server Error</div>
9
+
10
+ <span>{props.error.message}</span>
11
+ </div>
12
+ </>
13
+ )
14
+ }
@@ -0,0 +1,21 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/pages/home.tsx') })
3
+ }}}
4
+ import { Head } from '@inertiajs/react'
5
+
6
+ export default function Home(props: { version: number }) {
7
+ return (
8
+ <>
9
+ <Head title="Homepage" />
10
+
11
+ <div className="container">
12
+ <div className="title">AdonisJS {props.version} x Inertia x React</div>
13
+
14
+ <span>
15
+ Learn more about AdonisJS and Inertia.js by visiting the{' '}
16
+ <a href="https://docs.adonisjs.com/guides/inertia">AdonisJS documentation</a>.
17
+ </span>
18
+ </div>
19
+ </>
20
+ )
21
+ }
@@ -0,0 +1,22 @@
1
+ {{{
2
+ exports({ to: app.makePath('resources/views/inertia_layout.edge') })
3
+ }}}
4
+ <!DOCTYPE html>
5
+ <html>
6
+
7
+ <head>
8
+ <meta charset="utf-8">
9
+ <meta name="viewport" content="width=device-width, initial-scale=1">
10
+
11
+ <title inertia>AdonisJS x Inertia x React</title>
12
+
13
+ @viteReactRefresh()
14
+ @inertiaHead()
15
+ {{ "@vite(['inertia/app/app.tsx', `inertia/pages/${page.component}.tsx`])" }}
16
+ </head>
17
+
18
+ <body>
19
+ @inertia()
20
+ </body>
21
+
22
+ </html>
@@ -0,0 +1,17 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/app/ssr.tsx') })
3
+ }}}
4
+ import ReactDOMServer from 'react-dom/server'
5
+ import { createInertiaApp } from '@inertiajs/react'
6
+
7
+ export default function render(page: any) {
8
+ return createInertiaApp({
9
+ page,
10
+ render: ReactDOMServer.renderToString,
11
+ resolve: (name) => {
12
+ const pages = import.meta.glob('../pages/**/*.tsx', { eager: true })
13
+ {{ 'return pages[`../pages/${name}.tsx`]' }}
14
+ },
15
+ setup: ({ App, props }) => <App {...props} />,
16
+ })
17
+ }
@@ -0,0 +1,15 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/tsconfig.json') })
3
+ }}}
4
+ {
5
+ "extends": "@adonisjs/tsconfig/tsconfig.client.json",
6
+ "compilerOptions": {
7
+ "baseUrl": ".",
8
+ "module": "ESNext",
9
+ "jsx": "react-jsx",
10
+ "paths": {
11
+ "~/*": ["./*"],
12
+ },
13
+ },
14
+ "include": ["./**/*.ts", "./**/*.tsx"],
15
+ }
@@ -0,0 +1,35 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/app/app.tsx') })
3
+ }}}
4
+ import '../css/app.css'
5
+
6
+ {{#if ssr}}
7
+ import { hydrate } from 'solid-js/web';
8
+ {{#else}}
9
+ import { render } from 'solid-js/web'
10
+ {{/if}}
11
+ import { createInertiaApp } from 'inertia-adapter-solid'
12
+ import { resolvePageComponent } from '@adonisjs/inertia/helpers'
13
+
14
+ const appName = import.meta.env.VITE_APP_NAME || 'AdonisJS'
15
+
16
+ createInertiaApp({
17
+ progress: { color: '#5468FF' },
18
+
19
+ title: (title) => {{ '`${title} - ${appName}`' }},
20
+
21
+ resolve: (name) => {
22
+ return resolvePageComponent(
23
+ {{ '`../pages/${name}.tsx`' }},
24
+ import.meta.glob('../pages/**/*.tsx'),
25
+ )
26
+ },
27
+
28
+ setup({ el, App, props }) {
29
+ {{#if ssr}}
30
+ hydrate(() => <App {...props} />, el)
31
+ {{#else}}
32
+ render(() => <App {...props} />, el)
33
+ {{/if}}
34
+ },
35
+ })
@@ -0,0 +1,14 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/pages/errors/not_found.tsx') })
3
+ }}}
4
+ export default function NotFound() {
5
+ return (
6
+ <>
7
+ <div class="container">
8
+ <div class="title">Page not found</div>
9
+
10
+ <span>This page does not exist.</span>
11
+ </div>
12
+ </>
13
+ )
14
+ }
@@ -0,0 +1,14 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/pages/errors/server_error.tsx') })
3
+ }}}
4
+ export default function ServerError(props: { error: any }) {
5
+ return (
6
+ <>
7
+ <div class="container">
8
+ <div class="title">Server Error</div>
9
+
10
+ <span>{props.error.message}</span>
11
+ </div>
12
+ </>
13
+ )
14
+ }
@@ -0,0 +1,18 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/pages/home.tsx') })
3
+ }}}
4
+
5
+ export default function Home(props: { version: number }) {
6
+ return (
7
+ <>
8
+ <div class="container">
9
+ <div class="title">AdonisJS {props.version} x Inertia x Solid.js</div>
10
+
11
+ <span>
12
+ Learn more about AdonisJS and Inertia.js by visiting the{' '}
13
+ <a href="https://docs.adonisjs.com/guides/inertia">AdonisJS documentation</a>.
14
+ </span>
15
+ </div>
16
+ </>
17
+ )
18
+ }
@@ -0,0 +1,21 @@
1
+ {{{
2
+ exports({ to: app.makePath('resources/views/inertia_layout.edge') })
3
+ }}}
4
+ <!DOCTYPE html>
5
+ <html>
6
+
7
+ <head>
8
+ <meta charset="utf-8">
9
+ <meta name="viewport" content="width=device-width, initial-scale=1">
10
+
11
+ <title inertia>AdonisJS x Inertia x SolidJS</title>
12
+
13
+ @inertiaHead()
14
+ {{ "@vite(['inertia/app/app.tsx', `inertia/pages/${page.component}.tsx`])" }}
15
+ </head>
16
+
17
+ <body>
18
+ @inertia()
19
+ </body>
20
+
21
+ </html>
@@ -0,0 +1,19 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/app/ssr.tsx') })
3
+ }}}
4
+
5
+ import { hydrate } from 'solid-js/web'
6
+ import { createInertiaApp } from 'inertia-adapter-solid'
7
+
8
+ export default function render(page: any) {
9
+ return createInertiaApp({
10
+ page,
11
+ resolve: (name) => {
12
+ const pages = import.meta.glob('../pages/**/*.tsx', { eager: true })
13
+ {{ 'return pages[`../pages/${name}.tsx`]' }}
14
+ },
15
+ setup({ el, App, props }) {
16
+ hydrate(() => <App {...props} />, el)
17
+ },
18
+ })
19
+ }
@@ -0,0 +1,16 @@
1
+ {{{
2
+ exports({ to: app.makePath('inertia/tsconfig.json') })
3
+ }}}
4
+ {
5
+ "extends": "@adonisjs/tsconfig/tsconfig.client.json",
6
+ "compilerOptions": {
7
+ "baseUrl": ".",
8
+ "jsx": "preserve",
9
+ "module": "ESNext",
10
+ "jsxImportSource": "solid-js",
11
+ "paths": {
12
+ "~/*": ["./*"],
13
+ },
14
+ },
15
+ "include": ["./**/*.ts", "./**/*.tsx"],
16
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Utility function to resolve a page component
3
+ *
4
+ * @example
5
+ * return resolvePageComponent(
6
+ * `./pages/${name}.vue`,
7
+ * import.meta.glob<DefineComponent>("./pages/**\/*.vue")
8
+ * )
9
+ */
10
+ declare function resolvePageComponent<T>(path: string | string[], pages: Record<string, Promise<T> | (() => Promise<T>)>): Promise<T>;
11
+
12
+ export { resolvePageComponent };
@@ -0,0 +1,14 @@
1
+ // src/helpers.ts
2
+ async function resolvePageComponent(path, pages) {
3
+ for (const p of Array.isArray(path) ? path : [path]) {
4
+ const page = pages[p];
5
+ if (typeof page === "undefined") {
6
+ continue;
7
+ }
8
+ return typeof page === "function" ? page() : page;
9
+ }
10
+ throw new Error(`Page not found: ${path}`);
11
+ }
12
+ export {
13
+ resolvePageComponent
14
+ };
@@ -1,6 +1,8 @@
1
+ import { Vite } from '@adonisjs/vite';
1
2
  import { HttpContext } from '@adonisjs/core/http';
2
3
  import { NextFn } from '@adonisjs/core/types/http';
3
- import { ResolvedConfig, PageProps, MaybePromise } from './types.js';
4
+ import { ResolvedConfig, Data, PageProps, PageObject, MaybePromise } from './types.js';
5
+ import '@tuyau/utils/types';
4
6
 
5
7
  /**
6
8
  * Symbol used to identify lazy props
@@ -13,16 +15,17 @@ declare class Inertia {
13
15
  #private;
14
16
  protected ctx: HttpContext;
15
17
  protected config: ResolvedConfig;
16
- constructor(ctx: HttpContext, config: ResolvedConfig);
18
+ protected vite?: Vite | undefined;
19
+ constructor(ctx: HttpContext, config: ResolvedConfig, vite?: Vite | undefined);
20
+ /**
21
+ * Share data for the current request.
22
+ * This data will override any shared data defined in the config.
23
+ */
24
+ share(data: Record<string, Data>): void;
17
25
  /**
18
26
  * Render a page using Inertia
19
27
  */
20
- render<TPageProps extends Record<string, any> = PageProps, TViewProps extends Record<string, any> = PageProps>(component: string, pageProps?: TPageProps, viewProps?: TViewProps): Promise<string | {
21
- component: string;
22
- version: string | number;
23
- props: any;
24
- url: string;
25
- }>;
28
+ render<TPageProps extends Record<string, any> = PageProps, TViewProps extends Record<string, any> = PageProps>(component: string, pageProps?: TPageProps, viewProps?: TViewProps): Promise<string | PageObject<TPageProps>>;
26
29
  /**
27
30
  * Create a lazy prop
28
31
  *
@@ -57,7 +60,8 @@ declare module '@adonisjs/core/http' {
57
60
  */
58
61
  declare class InertiaMiddleware {
59
62
  protected config: ResolvedConfig;
60
- constructor(config: ResolvedConfig);
63
+ protected vite?: Vite | undefined;
64
+ constructor(config: ResolvedConfig, vite?: Vite | undefined);
61
65
  handle(ctx: HttpContext, next: NextFn): Promise<void>;
62
66
  }
63
67
 
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  InertiaMiddleware
3
- } from "../chunk-GDULL3NT.js";
3
+ } from "../chunk-PJEYAPJB.js";
4
4
  export {
5
5
  InertiaMiddleware as default
6
6
  };
@@ -0,0 +1,85 @@
1
+ // src/plugins/edge/plugin.ts
2
+ import { encode } from "html-entities";
3
+
4
+ // src/debug.ts
5
+ import { debuglog } from "node:util";
6
+ var debug_default = debuglog("adonisjs:inertia");
7
+
8
+ // src/plugins/edge/tags.ts
9
+ import { EdgeError } from "edge-error";
10
+
11
+ // src/plugins/edge/utils.ts
12
+ function isSubsetOf(expression, expressions, errorCallback) {
13
+ if (!expressions.includes(expression.type)) {
14
+ errorCallback();
15
+ }
16
+ }
17
+
18
+ // src/plugins/edge/tags.ts
19
+ var inertiaTag = {
20
+ block: false,
21
+ tagName: "inertia",
22
+ seekable: true,
23
+ compile(parser, buffer, { filename, loc, properties }) {
24
+ if (properties.jsArg.trim() === "") {
25
+ buffer.writeExpression(`out += state.inertia(state.page)`, filename, loc.start.line);
26
+ return;
27
+ }
28
+ properties.jsArg = `(${properties.jsArg})`;
29
+ const parsed = parser.utils.transformAst(
30
+ parser.utils.generateAST(properties.jsArg, loc, filename),
31
+ filename,
32
+ parser
33
+ );
34
+ isSubsetOf(parsed, ["ObjectExpression"], () => {
35
+ const { line, col } = parser.utils.getExpressionLoc(parsed);
36
+ throw new EdgeError(
37
+ `"${properties.jsArg}" is not a valid argument for @inertia`,
38
+ "E_UNALLOWED_EXPRESSION",
39
+ { line, col, filename }
40
+ );
41
+ });
42
+ const attributes = parser.utils.stringify(parsed);
43
+ buffer.writeExpression(
44
+ `out += state.inertia(state.page, ${attributes})`,
45
+ filename,
46
+ loc.start.line
47
+ );
48
+ }
49
+ };
50
+ var inertiaHeadTag = {
51
+ block: false,
52
+ tagName: "inertiaHead",
53
+ seekable: false,
54
+ compile(_, buffer, { filename, loc }) {
55
+ buffer.writeExpression(`out += state.inertiaHead(state.page)`, filename, loc.start.line);
56
+ }
57
+ };
58
+
59
+ // src/plugins/edge/plugin.ts
60
+ var edgePluginInertia = () => {
61
+ return (edge) => {
62
+ debug_default("sharing globals and inertia tags with edge");
63
+ edge.global(
64
+ "inertia",
65
+ (page = {}, attributes = {}) => {
66
+ if (page.ssrBody)
67
+ return page.ssrBody;
68
+ const className = attributes?.class ? ` class="${attributes.class}"` : "";
69
+ const id = attributes?.id ? ` id="${attributes.id}"` : ' id="app"';
70
+ const tag = attributes?.as || "div";
71
+ const dataPage = encode(JSON.stringify(page));
72
+ return `<${tag}${id}${className} data-page="${dataPage}"></${tag}>`;
73
+ }
74
+ );
75
+ edge.global("inertiaHead", (page) => {
76
+ const { ssrHead = [] } = page || {};
77
+ return ssrHead.join("\n");
78
+ });
79
+ edge.registerTag(inertiaHeadTag);
80
+ edge.registerTag(inertiaTag);
81
+ };
82
+ };
83
+ export {
84
+ edgePluginInertia
85
+ };
@@ -1,6 +1,7 @@
1
1
  import { PluginFn } from '@japa/runner/types';
2
- import { PageProps } from '../types.js';
3
2
  import { ApplicationService } from '@adonisjs/core/types';
3
+ import { PageProps } from '../../types.js';
4
+ import '@tuyau/utils/types';
4
5
  import '@adonisjs/core/http';
5
6
 
6
7
  declare module '@japa/api-client' {
@@ -1,4 +1,4 @@
1
- // src/plugins/api_client.ts
1
+ // src/plugins/japa/api_client.ts
2
2
  import { configProvider } from "@adonisjs/core";
3
3
  import { RuntimeException } from "@poppinss/utils";
4
4
  import { ApiRequest, ApiResponse } from "@japa/api-client";
@@ -0,0 +1,26 @@
1
+ import { PluginOption } from 'vite';
2
+
3
+ type InertiaPluginOptions = {
4
+ ssr?: {
5
+ /**
6
+ * Whether or not to enable server-side rendering
7
+ */
8
+ enabled: true;
9
+ /**
10
+ * The entrypoint for the server-side rendering
11
+ */
12
+ entrypoint: string;
13
+ /**
14
+ * The output directory for the server-side rendering bundle
15
+ */
16
+ output?: string;
17
+ } | {
18
+ enabled: false;
19
+ };
20
+ };
21
+ /**
22
+ * Inertia plugin for Vite that is tailored for AdonisJS
23
+ */
24
+ declare function inertia(options?: InertiaPluginOptions): PluginOption;
25
+
26
+ export { type InertiaPluginOptions, inertia as default };
@@ -0,0 +1,36 @@
1
+ // src/plugins/vite.ts
2
+ function inertia(options) {
3
+ return {
4
+ name: "vite-plugin-inertia",
5
+ config: (_, { command }) => {
6
+ if (!options?.ssr?.enabled)
7
+ return {};
8
+ if (command === "build") {
9
+ process.env.NODE_ENV = "production";
10
+ }
11
+ return {
12
+ buildSteps: [
13
+ {
14
+ name: "build-client",
15
+ description: "build inertia client bundle",
16
+ config: { build: { outDir: "build/public/assets/" } }
17
+ },
18
+ {
19
+ name: "build-ssr",
20
+ description: "build inertia server bundle",
21
+ config: {
22
+ build: {
23
+ ssr: true,
24
+ outDir: options.ssr.output || "build/ssr",
25
+ rollupOptions: { input: options.ssr.entrypoint }
26
+ }
27
+ }
28
+ }
29
+ ]
30
+ };
31
+ }
32
+ };
33
+ }
34
+ export {
35
+ inertia as default
36
+ };