laravel / octane

Supercharge your Laravel application's performance.
https://laravel.com/docs/octane
MIT License
3.78k stars 296 forks source link

Mix asset function keeps data in memory #301

Closed Jefemy closed 3 years ago

Jefemy commented 3 years ago

Description:

Mix asset function keeps manifest data in memory causing issues with local development with the function outputting an invalid url

Steps To Reproduce:

sikhlana commented 3 years ago

Does adding the '--watch' switch fix the issue?

Jefemy commented 3 years ago

Does adding the '--watch' switch fix the issue?

Already using it, although I just noticed that there is a watch config that allows me to add mix-manifest to be watched. Perhaps it should be included by default?

sikhlana commented 3 years ago

The watch config already includes the resources subdirectory. And mix-manifest.json isn't included as it's a generated file which doesn't exist if you never run NPM's build script.

driesvints commented 3 years ago

You shouldn't manually edit your mix-manifest.json. Like @sikhlana explained, the resources directory is already being watched when you use npm watch.

Jefemy commented 3 years ago

You shouldn't manually edit your mix-manifest.json. Like @sikhlana explained, the resources directory is already being watched when you use npm watch.

Am I reading the config wrong that by default only php files are being watched? https://github.com/laravel/octane/blob/54e6677304cf317403ac18f5e3511de864346cc5/config/octane.php#L175

sikhlana commented 3 years ago

The Mix Manifest needs to be kept in-memory due to performance issue but I guess in development mode that shouldn't be the case. I'll look at what I can do. In the mean time change resources/**/*.php to resources/**/* in your config file.