2024-08-24 23:08:42 +03:00
|
|
|
import fs from 'fs';
|
|
|
|
import {homedir} from 'os'
|
|
|
|
import {resolve} from 'path'
|
|
|
|
import { defineConfig } from 'vite';
|
|
|
|
import laravel from 'laravel-vite-plugin';
|
|
|
|
import purge from '@erbelion/vite-plugin-laravel-purgecss'
|
|
|
|
import inject from '@rollup/plugin-inject';
|
|
|
|
|
|
|
|
let host = 'playlab.test'
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
css: {
|
|
|
|
devSourcemap: true
|
|
|
|
},
|
|
|
|
resolve: {
|
|
|
|
alias: {
|
|
|
|
'~bootstrap': resolve(__dirname, 'node_modules/bootstrap'),
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
plugins: [
|
|
|
|
// inject({
|
|
|
|
// $: 'jquery',
|
|
|
|
// jQuery: 'jquery',
|
|
|
|
// include:'**.js'
|
|
|
|
// }),
|
|
|
|
laravel({
|
|
|
|
input: [
|
2024-08-25 22:33:45 +03:00
|
|
|
'resources/js/img.js',
|
2024-08-24 23:08:42 +03:00
|
|
|
'resources/scss/app.scss',
|
2024-08-25 20:48:48 +03:00
|
|
|
'resources/scss/fa.scss',
|
|
|
|
'resources/scss/la.scss',
|
2024-08-25 21:00:17 +03:00
|
|
|
'resources/scss/google-fonts.scss',
|
2024-08-25 18:55:02 +03:00
|
|
|
'resources/scss/watch.scss',
|
|
|
|
'resources/scss/home.scss',
|
2024-08-25 22:33:45 +03:00
|
|
|
// 'resources/vendor/css/fontawesome-all.min.css',
|
|
|
|
// 'resources/vendor/css/line-awesome.min.css',
|
2024-08-24 23:08:42 +03:00
|
|
|
'resources/js/app.js',
|
2024-08-25 18:55:02 +03:00
|
|
|
'resources/js/home.js',
|
|
|
|
'resources/js/watch.js',
|
2024-08-24 23:08:42 +03:00
|
|
|
'resources/js/load-more.js',
|
2024-08-25 22:37:16 +03:00
|
|
|
'resources/js/jqfix.js',
|
2024-08-24 23:08:42 +03:00
|
|
|
// 'resources/js/components/Player.js',
|
|
|
|
],
|
|
|
|
refresh: {paths:['./resources/*','./resources/views/*','./resources/views/*/*', './resources/scss/*', './resources/js/*'], config:true},
|
|
|
|
}),
|
|
|
|
purge({
|
|
|
|
templates: ['blade'],
|
|
|
|
safelist: {
|
|
|
|
deep: [/dropdown-menu$/, /navbar$/],
|
2024-08-25 18:55:02 +03:00
|
|
|
greedy: [/la-(long|facebook|linkedin|twitter|pinterest|plus-circle)/, /fa-(search|play)/, /show$/, /collapsing$/, /aos/, /data/, /reveal/, /show-filters/, /modal/, /collapsed/, /expand/, /slideout/, /^navbar/, /collapse/, /slick/, /prev/, /next/]
|
2024-08-24 23:08:42 +03:00
|
|
|
},
|
|
|
|
})
|
|
|
|
],
|
|
|
|
server: detectServerConfig(host),
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
function detectServerConfig(host) {
|
|
|
|
let keyPath = resolve(homedir(), `.valet/Certificates/${host}.key`)
|
|
|
|
let certificatePath = resolve(homedir(), `.valet/Certificates/${host}.crt`)
|
|
|
|
|
|
|
|
if (!fs.existsSync(keyPath)) {
|
|
|
|
return {}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!fs.existsSync(certificatePath)) {
|
|
|
|
return {}
|
|
|
|
}
|
|
|
|
|
|
|
|
return {
|
|
|
|
hmr: {host},
|
|
|
|
host,
|
|
|
|
https: {
|
|
|
|
key: fs.readFileSync(keyPath),
|
|
|
|
cert: fs.readFileSync(certificatePath),
|
|
|
|
},
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|