Fixed the build warnings.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import Hls from 'hls.js';
|
import Hls from 'hls.js/light';
|
||||||
import { useEffect, useRef } from 'react';
|
import { useEffect, useRef } from 'react';
|
||||||
|
|
||||||
export function VideoPlayer({
|
export function VideoPlayer({
|
||||||
|
|||||||
8
resources/js/types/hls-light.d.ts
vendored
Normal file
8
resources/js/types/hls-light.d.ts
vendored
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
// this well reduces hls-vendor from +500KB to +300KB n builds
|
||||||
|
|
||||||
|
declare module 'hls.js/light' {
|
||||||
|
import Hls from 'hls.js';
|
||||||
|
|
||||||
|
export * from 'hls.js';
|
||||||
|
export default Hls;
|
||||||
|
}
|
||||||
@@ -7,6 +7,44 @@ import { bunny } from 'laravel-vite-plugin/fonts';
|
|||||||
import { defineConfig } from 'vite';
|
import { defineConfig } from 'vite';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
|
build: {
|
||||||
|
rolldownOptions: {
|
||||||
|
checks: {
|
||||||
|
pluginTimings: false,
|
||||||
|
},
|
||||||
|
output: {
|
||||||
|
codeSplitting: {
|
||||||
|
groups: [
|
||||||
|
{
|
||||||
|
name: 'react-vendor',
|
||||||
|
test: /node_modules[\\/](react|react-dom)[\\/]/,
|
||||||
|
priority: 40,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'inertia-vendor',
|
||||||
|
test: /node_modules[\\/]@inertiajs[\\/]/,
|
||||||
|
priority: 35,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'radix-vendor',
|
||||||
|
test: /node_modules[\\/]@radix-ui[\\/]/,
|
||||||
|
priority: 30,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'hls-vendor',
|
||||||
|
test: /node_modules[\\/]hls\.js[\\/]/,
|
||||||
|
priority: 30,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: 'ui-vendor',
|
||||||
|
test: /node_modules[\\/](lucide-react|sonner|class-variance-authority|clsx|tailwind-merge)[\\/]/,
|
||||||
|
priority: 20,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
plugins: [
|
plugins: [
|
||||||
laravel({
|
laravel({
|
||||||
input: ['resources/css/app.css', 'resources/js/app.tsx'],
|
input: ['resources/css/app.css', 'resources/js/app.tsx'],
|
||||||
|
|||||||
Reference in New Issue
Block a user