Skip to content

Commit

Permalink
Merge pull request #212 from yungifez/shift-77976
Browse files Browse the repository at this point in the history
Migrate from Laravel Mix to Vite
  • Loading branch information
yungifez authored Jan 13, 2023
2 parents 2184247 + 90e047c commit 57b14d8
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 41 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

LOGO_PATH="img/logo/logo.jpg"

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/node_modules
/public/hot
/public/build
/public/storage
/storage/*.key
/vendor
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"fruitcake/laravel-cors": "^2.0.5",
"guzzlehttp/guzzle": "^7.2",
"jeroennoten/laravel-adminlte": "^3.7",
"laravel/framework": "^9.0",
"laravel/framework": "^9.19",
"laravel/jetstream": "^2.6",
"laravel/sanctum": "^2.14",
"laravel/tinker": "^2.7",
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ services:
- 'host.docker.internal:host-gateway'
ports:
- '${APP_PORT:-80}:80'
- '${VITE_PORT:-5173}:${VITE_PORT:-5173}'
- '${HMR_PORT:-8080}:8080'
environment:
WWWUSER: '${WWWUSER}'
Expand Down
15 changes: 6 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -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": {
"@fortawesome/fontawesome-free": "^5.15.1",
Expand All @@ -19,7 +14,6 @@
"axios": "^0.25",
"bootstrap": "^4.6.0",
"jquery": "^3.5.1",
"laravel-mix": "^6.0.49",
"lodash": "^4.17.19",
"overlayscrollbars": "^1.13.0",
"popper.js": "^1.16.1",
Expand All @@ -28,6 +22,9 @@
"resolve-url-loader": "^5.0.0",
"sass": "^1.43.4",
"sass-loader": "^12.1.0",
"tailwindcss": "^2.2.2"
"tailwindcss": "^2.2.2",
"vite": "^3.0.2",
"laravel-vite-plugin": "^0.6.0",
"autoprefixer": "^10.4.0"
}
}
4 changes: 2 additions & 2 deletions resources/views-old/layouts/guest.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
<link href="https://fonts.googleapis.com/css?family=Nunito:400,600,700" rel="stylesheet">

<!-- Styles -->
<link rel="stylesheet" href="{{ mix('css/app.css') }}">
@vite('resources/css/app.css')
@livewireStyles

<!--Shortcut icon-->
<link rel="shortcut icon" href="favicons/favicon.ico" type="image/x-icon">

<!-- Scripts -->
<script src="{{ mix('js/app.js') }}" defer></script>
@vite('resources/js/app.js')
</head>
<body class="bg-light font-sans antialiased">
{{ $slot }}
Expand Down
2 changes: 1 addition & 1 deletion resources/views-old/profile/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@

@section('js')
<!-- Scripts -->
<script src="{{ mix('js/app.js') }}" defer></script>
@vite('resources/js/app.js')
@endsection
16 changes: 16 additions & 0 deletions vite.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';

export default defineConfig({
plugins: [
laravel({
input: [
'resources/sass/app.scss',
'resources/sass/dashboard/dashboard.scss',
'resources/js/app.js',
'resources/js/dashboard.js',
],
refresh: true,
}),
],
});
26 changes: 0 additions & 26 deletions webpack.mix.js

This file was deleted.

0 comments on commit 57b14d8

Please sign in to comment.