Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fidum/nova-package-bundler-command
Improves Laravel Nova initial load speeds by combining all third party package assets into a single file.
https://github.com/fidum/nova-package-bundler-command
laravel laravel-framework laravel-package nova
Last synced: 3 days ago
JSON representation
Improves Laravel Nova initial load speeds by combining all third party package assets into a single file.
- Host: GitHub
- URL: https://github.com/fidum/nova-package-bundler-command
- Owner: fidum
- License: mit
- Created: 2023-01-30T11:09:10.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-03-25T09:29:04.000Z (6 months ago)
- Last Synced: 2024-03-25T10:46:23.833Z (6 months ago)
- Topics: laravel, laravel-framework, laravel-package, nova
- Language: PHP
- Homepage:
- Size: 77.1 KB
- Stars: 17
- Watchers: 0
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE.md
Awesome Lists containing this project
README
# Improves Laravel Nova initial load speeds by combining all third party package assets into a single file.
[![Latest Version on Packagist](https://img.shields.io/packagist/v/fidum/nova-package-bundler-command.svg?style=for-the-badge)](https://packagist.org/packages/fidum/nova-package-bundler-command)
[![GitHub Workflow Status (with branch)](https://img.shields.io/github/actions/workflow/status/fidum/nova-package-bundler-command/run-tests.yml?branch=main&style=for-the-badge)](https://github.com/fidum/nova-package-bundler-command/actions?query=workflow%3Arun-tests+branch%3Amaster)
[![Twitter Follow](https://img.shields.io/badge/follow-%40danmasonmp-1DA1F2?logo=twitter&style=for-the-badge)](https://twitter.com/danmasonmp)## Installation
You can install the package via composer:
```bash
composer require fidum/nova-package-bundler-command
```You can publish the config file with:
```bash
php artisan vendor:publish --tag="nova-package-bundler-command-config"
```[Click here to see the contents of the config file](config/nova-package-bundler-command.php).
You should read through the config, which serves as additional documentation and make changes as needed.
Update Nova configuration file in `config/nova.php`. Add the `OverrideNovaPackagesMiddleware` to the `middleware` option after `BootTools`:
```php
use Fidum\NovaPackageBundler\Http\Middleware\OverrideNovaPackagesMiddleware;
use Laravel\Nova\Http\Middleware\BootTools;
use Laravel\Nova\Http\Middleware\DispatchServingNovaEvent;
use Laravel\Nova\Http\Middleware\HandleInertiaRequests;return [
// ...
'middleware' => [
'web',
HandleInertiaRequests::class,
DispatchServingNovaEvent::class,
BootTools::class,
OverrideNovaPackagesMiddleware::class
],// ...
];
```## Usage
Run the below command whenever you upgrade your third party nova packages. This should output the files configured above, you should commit the files to your repo.
```console
$ php artisan nova:tools:publishBooting tool [App\Nova\Tools\HelpLink] .................................................................................................. 0ms DONE
Booting tool [App\Nova\Tools\QuickQuote] ................................................................................................ 0ms DONEReading asset [1feb8c78f6bd6ba8a6a29cab353ebd8d] from [public/vendor/nova-kit/nova-packages-tool/tool.js] ............................... 0ms DONE
Reading asset [nova-apex-chart] from [vendor/coroowicaksono/chart-js-integration/src/../dist/js/chart-js-integration.js] ................ 3ms DONE
Reading asset [multiselect-field] from [vendor/outl1ne/nova-multiselect-field/src/../dist/js/entry.js] .................................. 2ms DONE
Reading asset [nova-multiselect-filter] from [vendor/outl1ne/nova-multiselect-filter/src/../dist/js/entry.js] ........................... 2ms DONE
Reading asset [nova-opening-hours-field] from [vendor/sadekd/nova-opening-hours-field/src/../dist/js/field.js] .......................... 1ms DONE
Reading asset [nova-tag-input] from [vendor/superlatif/nova-tag-input/src/../dist/js/field.js] .......................................... 2ms DONE
Writing file [public/vendor/nova-tools/app.js] .......................................................................................... 1ms DONEReading asset [multiselect-field] from [vendor/outl1ne/nova-multiselect-field/src/../dist/css/entry.css] ................................ 0ms DONE
Reading asset [nova-multiselect-filter] from [vendor/outl1ne/nova-multiselect-filter/src/../dist/css/entry.css] ......................... 0ms DONE
Reading asset [nova-opening-hours-field] from [vendor/sadekd/nova-opening-hours-field/src/../dist/css/field.css] ........................ 0ms DONE
Reading asset [nova-tag-input] from [vendor/superlatif/nova-tag-input/src/../dist/css/field.css] ........................................ 0ms DONE
Writing file [public/vendor/nova-tools/app.css] ......................................................................................... 0ms DONE
```## Testing
```bash
composer test
```## Changelog
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
## Contributing
Please see [CONTRIBUTING](https://github.com/dmason30/.github/blob/main/CONTRIBUTING.md) for details.
## Credits
- [Dan Mason](https://github.com/dmason30)
- [All Contributors](../../contributors)## License
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.