Skip to content

NejcBW/InertiaCoreVueTemplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

InertiaCoreVueTemplate

Running

To run the dev environment:

cd ClientApp
npm run dev

# in another terminal in the Inertia CoreVueApp project directory
dotnet watch run

Changing from TypeScript to JavaScript

To change the project from TypeScript to JavaScript you should perform the following changes in the ClientApp folder:

  1. Rename vite.config.ts to vite.config.js. No content must be changed.
  2. Remove tsconfig.json file because it is not needed.
  3. From package.json remove the following dependencies:
    • ts-node
    • typescript
    • vue-tsc
  4. Rename app.ts to app.js and make the following changes:
-import {createApp, h, DefineComponent} from 'vue';
+import {createApp, h} from 'vue';
import {createInertiaApp} from '@inertiajs/vue3';
import {resolvePageComponent} from 'laravel-vite-plugin/inertia-helpers';
import './app.css';

const appName = window.document.getElementsByTagName('title')[0]?.innerText || 'Inertia';

createInertiaApp({
    title: (title) => `${title} - ${appName}`,
    resolve: (name) =>
        resolvePageComponent(
            `./Pages/${name}.vue`,
-            import.meta.glob<DefineComponent>('./Pages/**/*.vue')
+            import.meta.glob('./Pages/**/*.vue')
        ),
    setup({el, App, props, plugin}) {
        createApp({render: () => h(App, props)})
            .use(plugin)
            .mount(el);
    },
    progress: {
        color: '#4B5563',
    },
});
  1. Rename bootstrap.ts to bootstrap.js.
  2. You also need to modify the Index.vue file accordingly.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published