test build container
All checks were successful
Docker Version Check / check-docker (push) Successful in 15s
All checks were successful
Docker Version Check / check-docker (push) Successful in 15s
This commit is contained in:
31
inertia/app/app.ts
Normal file
31
inertia/app/app.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
/// <reference path="../../adonisrc.ts" />
|
||||
/// <reference path="../../config/inertia.ts" />
|
||||
|
||||
import '../css/app.css';
|
||||
import { createSSRApp, h } from 'vue'
|
||||
import type { DefineComponent } from 'vue'
|
||||
import { createInertiaApp } from '@inertiajs/vue3'
|
||||
import { resolvePageComponent } from '@adonisjs/inertia/helpers'
|
||||
|
||||
const appName = import.meta.env.VITE_APP_NAME || 'AdonisJS'
|
||||
|
||||
createInertiaApp({
|
||||
progress: { color: '#5468FF' },
|
||||
|
||||
title: (title) => `${title} - ${appName}`,
|
||||
|
||||
resolve: (name) => {
|
||||
return resolvePageComponent(
|
||||
`../pages/${name}.vue`,
|
||||
import.meta.glob<DefineComponent>('../pages/**/*.vue'),
|
||||
)
|
||||
},
|
||||
|
||||
setup({ el, App, props, plugin }) {
|
||||
|
||||
createSSRApp({ render: () => h(App, props) })
|
||||
|
||||
.use(plugin)
|
||||
.mount(el)
|
||||
},
|
||||
})
|
||||
19
inertia/app/ssr.ts
Normal file
19
inertia/app/ssr.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
import { createInertiaApp } from '@inertiajs/vue3'
|
||||
import { renderToString } from '@vue/server-renderer'
|
||||
import { createSSRApp, h, type DefineComponent } from 'vue'
|
||||
|
||||
export default function render(page: any) {
|
||||
return createInertiaApp({
|
||||
page,
|
||||
render: renderToString,
|
||||
resolve: (name) => {
|
||||
const pages = import.meta.glob<DefineComponent>('../pages/**/*.vue', { eager: true })
|
||||
return pages[`../pages/${name}.vue`]
|
||||
},
|
||||
|
||||
setup({ App, props, plugin }) {
|
||||
return createSSRApp({ render: () => h(App, props) }).use(plugin)
|
||||
},
|
||||
})
|
||||
}
|
||||
10
inertia/css/app.css
Normal file
10
inertia/css/app.css
Normal file
@@ -0,0 +1,10 @@
|
||||
* {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
7
inertia/pages/errors/not_found.vue
Normal file
7
inertia/pages/errors/not_found.vue
Normal file
@@ -0,0 +1,7 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div class="title">Page not found</div>
|
||||
|
||||
<span>This page does not exist.</span>
|
||||
</div>
|
||||
</template>
|
||||
11
inertia/pages/errors/server_error.vue
Normal file
11
inertia/pages/errors/server_error.vue
Normal file
@@ -0,0 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
defineProps<{ error: any }>();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="container">
|
||||
<div class="title">Server Error</div>
|
||||
|
||||
<span>{{ error.message }}</span>
|
||||
</div>
|
||||
</template>
|
||||
10
inertia/pages/home.vue
Normal file
10
inertia/pages/home.vue
Normal file
@@ -0,0 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import { Head } from '@inertiajs/vue3'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Head title="Homepage" />
|
||||
<div>
|
||||
J. Leroy
|
||||
</div>
|
||||
</template>
|
||||
13
inertia/tsconfig.json
Normal file
13
inertia/tsconfig.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"extends": "@adonisjs/tsconfig/tsconfig.client.json",
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"jsx": "preserve",
|
||||
"module": "ESNext",
|
||||
"jsxImportSource": "vue",
|
||||
"paths": {
|
||||
"~/*": ["./*"],
|
||||
},
|
||||
},
|
||||
"include": ["./**/*.ts", "./**/*.vue"],
|
||||
}
|
||||
Reference in New Issue
Block a user