Skip to content

Commit

Permalink
Install Vite Livewire Plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdelElrafa committed Nov 29, 2023
1 parent 3417a4d commit 55ee922
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 5 deletions.
32 changes: 32 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@
"build": "vite build"
},
"devDependencies": {
"@defstudio/vite-livewire-plugin": "^1.3.2",
"@tailwindcss/forms": "^0.5.6",
"@tailwindcss/typography": "^0.5.9",
"alpinejs": "^3.13.0",
"autoprefixer": "^10.4.15",
"axios": "^1.1.2",
"blade-formatter": "^1.37.1",
"laravel-vite-plugin": "^0.8.0",
"postcss": "^8.4.29",
"tailwindcss": "^3.3.3",
"vite": "^4.0.0",
"@tailwindcss/forms": "^0.5.6",
"@tailwindcss/typography": "^0.5.9"
"vite": "^4.0.0"
}
}
6 changes: 5 additions & 1 deletion resources/js/app.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
import "./bootstrap";

import.meta.glob(["../images/**"]);

import {
Livewire,
Alpine,
} from "../../vendor/livewire/livewire/dist/livewire.esm";

Livewire.start();

import { livewire_hot_reload } from "virtual:livewire-hot-reload";
livewire_hot_reload();
8 changes: 7 additions & 1 deletion vite.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import { defineConfig } from "vite";
import laravel from "laravel-vite-plugin";

import livewire from "@defstudio/vite-livewire-plugin";

export default defineConfig({
plugins: [
laravel({
input: ["resources/css/app.css", "resources/js/app.js"],
refresh: true,
refresh: false,
}),

livewire({
refresh: ["resources/css/app.css"],
}),
],
});

0 comments on commit 55ee922

Please sign in to comment.