From 129dea19c4813cb5589eb017edd7b7c1bf0a3d18 Mon Sep 17 00:00:00 2001 From: Shift Date: Wed, 2 Jul 2025 18:27:49 +0000 Subject: [PATCH 1/8] Add npm dependencies --- package.json | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index da26689..cc83eb2 100644 --- a/package.json +++ b/package.json @@ -17,9 +17,8 @@ "lodash": "^4.17.19", "postcss": "^8.4.6", "postcss-import": "^14.0.2", - "tailwindcss": "^3.0.18" - }, - "dependencies": { - "laravel-mix": "^6.0.49" + "tailwindcss": "^3.0.18", + "vite": "^3.0.2", + "laravel-vite-plugin": "^0.6.0" } } From e375a06d7d7414f9c88c249887e683ca42932fd3 Mon Sep 17 00:00:00 2001 From: Shift Date: Wed, 2 Jul 2025 18:27:49 +0000 Subject: [PATCH 2/8] Update build scripts --- package.json | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index cc83eb2..46352ac 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,8 @@ { "private": true, "scripts": { - "dev": "npm run development", - "development": "mix", - "watch": "mix watch", - "watch-poll": "mix watch -- --watch-options-poll=1000", - "hot": "mix watch --hot", - "prod": "npm run production", - "production": "mix --production" + "dev": "vite", + "build": "vite build" }, "devDependencies": { "@tailwindcss/forms": "^0.4.0", From 62a44932df5b4a511ff078a51b61c0d4312ccfa8 Mon Sep 17 00:00:00 2001 From: Shift Date: Wed, 2 Jul 2025 18:27:49 +0000 Subject: [PATCH 3/8] Configure Vite --- vite.config.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 vite.config.js diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..89f26f5 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,14 @@ +import { defineConfig } from 'vite'; +import laravel from 'laravel-vite-plugin'; + +export default defineConfig({ + plugins: [ + laravel({ + input: [ + 'resources/css/app.css', + 'resources/js/app.js', + ], + refresh: true, + }), + ], +}); From 0f9e09606cdadae689f1f2e759023842653209e0 Mon Sep 17 00:00:00 2001 From: Shift Date: Wed, 2 Jul 2025 18:27:49 +0000 Subject: [PATCH 4/8] Remove `webpack.mix.js` --- webpack.mix.js | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100644 webpack.mix.js diff --git a/webpack.mix.js b/webpack.mix.js deleted file mode 100644 index c0e99dd..0000000 --- a/webpack.mix.js +++ /dev/null @@ -1,18 +0,0 @@ -const mix = require('laravel-mix'); - -/* - |-------------------------------------------------------------------------- - | Mix Asset Management - |-------------------------------------------------------------------------- - | - | Mix provides a clean, fluent API for defining some Webpack build steps - | for your Laravel applications. By default, we are compiling the CSS - | file for the application as well as bundling up all the JS files. - | - */ - -mix.js('resources/js/app.js', 'public/js').postCss('resources/css/app.css', 'public/css', [ - require('postcss-import'), - require('tailwindcss'), - require('autoprefixer'), -]); From 7d56232f3b8b19579b029bc9b76b7fc0dc7faebe Mon Sep 17 00:00:00 2001 From: Shift Date: Wed, 2 Jul 2025 18:27:49 +0000 Subject: [PATCH 5/8] Use ES modules --- resources/js/app.js | 2 +- resources/js/bootstrap.js | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/resources/js/app.js b/resources/js/app.js index 40c55f6..e59d6a0 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -1 +1 @@ -require('./bootstrap'); +import './bootstrap'; diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js index 6922577..7e155ec 100644 --- a/resources/js/bootstrap.js +++ b/resources/js/bootstrap.js @@ -1,4 +1,5 @@ -window._ = require('lodash'); +import _ from 'lodash'; +window._ = _; /** * We'll load the axios HTTP library which allows us to easily issue requests @@ -6,7 +7,8 @@ window._ = require('lodash'); * CSRF token as a header based on the value of the "XSRF" token cookie. */ -window.axios = require('axios'); +import axios from 'axios'; +window.axios = axios; window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; From ab6ed99760ea41be5a57257f48dcf0ce5870d5bc Mon Sep 17 00:00:00 2001 From: Shift Date: Wed, 2 Jul 2025 18:27:50 +0000 Subject: [PATCH 6/8] Rename ENV variables --- resources/js/bootstrap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js index 7e155ec..0f3a0a1 100644 --- a/resources/js/bootstrap.js +++ b/resources/js/bootstrap.js @@ -24,7 +24,7 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; // window.Echo = new Echo({ // broadcaster: 'pusher', -// key: process.env.MIX_PUSHER_APP_KEY, -// cluster: process.env.MIX_PUSHER_APP_CLUSTER, +// key: import.meta.env.VITE_PUSHER_APP_KEY, +// cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER, // forceTLS: true // }); From fcd33178f81ac3653697fb2e4f7fd6dca366cced Mon Sep 17 00:00:00 2001 From: Shift Date: Wed, 2 Jul 2025 18:27:50 +0000 Subject: [PATCH 7/8] Add PostCSS configuration for Tailwind --- postcss.config.js | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 postcss.config.js diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..fef1b22 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,6 @@ +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} From a073062630200f8c42a3256cd49937353aa64e9a Mon Sep 17 00:00:00 2001 From: Shift Date: Wed, 2 Jul 2025 18:27:50 +0000 Subject: [PATCH 8/8] Ignore build assets --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1e40815..29b3249 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /node_modules /public/hot +/public/build /public/storage /public/css /public/js