Skip to content

Allow auto-importing of pages/*.imba #9

@andregoldstein

Description

@andregoldstein

I'm wondering if it would be possible to use Vite's glob imports to auto import the relevant pages/*.imba file as documented in the Svelte example? Eg:

const pages = import.meta.glob('../pages/**/*.svelte')

createInertiaApp({ 
  resolve: name => pages[`../pages/${name}.svelte`](),
  setup({ el, App, props }) {
    new App({ target: el, props })
  },
})

This would save having to manually import each imba page file. Not sure if it's possible using the current way createInertiaApp resolves...

If not, it's not a huge deal to create a pages/index.imba file and to import each page there and then include it in the entry file bit might be one less step!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions