Skip to content

A DDEV addon to share vite projects locally using wildcard DNS

License

Notifications You must be signed in to change notification settings

webhubworks/ddev-share-local

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ddev-share-local

Share vite projects locally using nip.io. This currently handles only CraftCMS and Laravel projects.

Usage

ddev share-local

Configure Vite

Bind Vite to all interfaces and set the correct origin when currently sharing:

// vite.config.js

const url = new URL(process.env.SHARE_URL ?? process.env.DDEV_PRIMARY_URL)

export default defineConfig({
   // …
    server: {
        host: '0.0.0.0',
        port: 5173,
        strictPort: true,
        origin: `${url.origin}:5173`,
        hmr: {
            protocol: "wss",
            host: url.host
        }
    },
   // …
});

About

A DDEV addon to share vite projects locally using wildcard DNS

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages