mirror of
https://github.com/laravel/laravel.git
synced 2025-02-20 11:53:14 +08:00
[9.x] Vite (#5904)
* Use Vite * Gitignore Vite build directory * Use CSS entry points * Update plugin * Linting * Update plugin
This commit is contained in:
parent
0c3d1fabe5
commit
86b4b1b656
@ -48,5 +48,5 @@ PUSHER_APP_KEY=
|
|||||||
PUSHER_APP_SECRET=
|
PUSHER_APP_SECRET=
|
||||||
PUSHER_APP_CLUSTER=mt1
|
PUSHER_APP_CLUSTER=mt1
|
||||||
|
|
||||||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||||
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,4 +1,5 @@
|
|||||||
/node_modules
|
/node_modules
|
||||||
|
/public/build
|
||||||
/public/hot
|
/public/hot
|
||||||
/public/storage
|
/public/storage
|
||||||
/storage/*.key
|
/storage/*.key
|
||||||
|
@ -8,5 +8,5 @@ php:
|
|||||||
js:
|
js:
|
||||||
finder:
|
finder:
|
||||||
not-name:
|
not-name:
|
||||||
- webpack.mix.js
|
- vite.config.js
|
||||||
css: true
|
css: true
|
||||||
|
14
package.json
14
package.json
@ -1,18 +1,14 @@
|
|||||||
{
|
{
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "npm run development",
|
"dev": "vite",
|
||||||
"development": "mix",
|
"build": "vite build"
|
||||||
"watch": "mix watch",
|
|
||||||
"watch-poll": "mix watch -- --watch-options-poll=1000",
|
|
||||||
"hot": "mix watch --hot",
|
|
||||||
"prod": "npm run production",
|
|
||||||
"production": "mix --production"
|
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"axios": "^0.25",
|
"axios": "^0.25",
|
||||||
"laravel-mix": "^6.0.6",
|
"laravel-vite-plugin": "^0.2.1",
|
||||||
"lodash": "^4.17.19",
|
"lodash": "^4.17.19",
|
||||||
"postcss": "^8.1.14"
|
"postcss": "^8.1.14",
|
||||||
|
"vite": "^2.9.11"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
resources/js/bootstrap.js
vendored
4
resources/js/bootstrap.js
vendored
@ -25,7 +25,7 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
|
|||||||
|
|
||||||
// window.Echo = new Echo({
|
// window.Echo = new Echo({
|
||||||
// broadcaster: 'pusher',
|
// broadcaster: 'pusher',
|
||||||
// key: process.env.MIX_PUSHER_APP_KEY,
|
// key: import.meta.env.VITE_PUSHER_APP_KEY,
|
||||||
// cluster: process.env.MIX_PUSHER_APP_CLUSTER,
|
// cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER,
|
||||||
// forceTLS: true
|
// forceTLS: true
|
||||||
// });
|
// });
|
||||||
|
11
vite.config.js
Normal file
11
vite.config.js
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
import { defineConfig } from 'vite';
|
||||||
|
import laravel from 'laravel-vite-plugin';
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
plugins: [
|
||||||
|
laravel([
|
||||||
|
'resources/css/app.css',
|
||||||
|
'resources/js/app.js',
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
});
|
@ -1,17 +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', [
|
|
||||||
//
|
|
||||||
]);
|
|
Loading…
x
Reference in New Issue
Block a user