Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vite 5 manifest path #29

Open
stanislavprokopov opened this issue Nov 1, 2024 · 1 comment
Open

Vite 5 manifest path #29

stanislavprokopov opened this issue Nov 1, 2024 · 1 comment

Comments

@stanislavprokopov
Copy link

$this->manifestPath = FileHelper::createUrl($bundle->sourcePath, self::MANIFEST_FILE_NAME);

manifest path has changed in Vite 5, so cannot simply use sourcePath to build path to the manifest.json

Maybe simply check if manifestPath is already set in service config then dont override it.

@tomdavies
Copy link

I've also hit this same issue when trying to use this package with Vite 5+, which writes the manifest to ${outDir}/.vite/manifest.json. Everything works great with Vite dev server, but the incorrect hardcoded part of the manifest path means no assets are registered when in production / build mode.

@khalwat is there any chance of a fix for this?

It should be an easy lift and would extend the lifetime / usefulness of this package, especially given that Vite is now on v6. Currently a protected class constant is used for the manifest file name. All that's really needed here is for that to be a public property instead, so that it can be overridden.

I've worked around this by subclassing VitePluginService to set the correct path, but it would be much nicer to just be able to pass the manifest path + filename relative to the output dir when configuring the service, especially as Vite itself allows for configuration of the manifest file name (though not - annoyingly - it seems the manifest output path)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants