Problem/Motivation
Vite 5 changes the default location of generated manifest.json file. From `dist/manifest.json` to `dist/.vite/manifest.json`. https://github.com/vitejs/vite/pull/14230
Currently, when loading the manifest.json if the manifest path is not explicitly configured, a default value of `dist/manifest.json` is used. This will need to change for Vite 5.
Proposed resolution
Instead of statically using default path `dist/manifest.json`, check if `dist/manifest.json` file exists if so use it as a default value, if not use `dist/.vite/manifest.json`. This will add support for Vite 5 while providing backward compatibility with Vite 4.
Issue fork vite-3401054
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
darvanenAlso this line 165 in AssetLibrary.php now fails because vite returns a 200 instead of 404:
return $this->httpClient->request('GET', $this->getDevServerBaseUrl(), ['http_errors' => FALSE])->getStatusCode() === 404;Comment #4
darvanenI note the manifest.json location work is already in 1.x-dev so I think this is all that's left for Vite 5 compatibility?
Comment #5
wotnakChange looks good. The only thing to fix is one issue reported by phpstan (you can see it in the merge request ui).
The in_array function should be called with the third parameter set to true to strictly compare values, including checking their types. https://www.php.net/manual/en/function.in-array.php#refsect1-function.in...
Comment #8
wotnakComment #9
wotnakAvailable in the 1.1.1 release.
Comment #10
darvanenMany thanks for tidying that up and the swift release :)