@aerni/vite-plugin-laravel-cloudflared
v1.0.0
Published
Companion plugin to seamlessly integrate Cloudflared for Laravel with your Vite development server
Downloads
90
Maintainers
Readme
Cloudflared for Vite
This Vite plugin is the companion to Cloudflared for Laravel. It allows access to your development server via your Cloudflare tunnel with full HMR support.
Requirements
This plugin requires Cloudflared for Laravel. Install that package first.
Installation
npm install @aerni/vite-plugin-laravel-cloudflaredUsage
Add the plugin to your vite.config.js:
import { defineConfig } from 'vite'
import cloudflared from '@aerni/vite-plugin-laravel-cloudflared'
export default defineConfig({
plugins: [
cloudflared()
]
})Enable the Cloudflare tunnel by setting the CLOUDFLARED_ENABLED environment variable. You can either add it to your .env file:
CLOUDFLARED_ENABLED=trueOr create an npm script in package.json:
"scripts": {
"dev": "vite",
"tunnel": "CLOUDFLARED_ENABLED=true vite"
}Configuration
Configure the plugin's logLevel to control console output from the Cloudflare tunnel:
cloudflared({ logLevel: 'info' })License
Licensed under the MIT license.
Credits
Developed by Michael Aerni.
