mister-bk / craft-plugin-mix

Helper plugin for Laravel Mix in Craft CMS templates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Versioning doesn't work if mix public path is not set correctly - mix.setPublicPath()

amkdev opened this issue · comments

The plugin assumes that the mix-manifest.json and the asset files are in the same directory. This can lead to problems, because it requires that mix.setPublicPath() is set correctly in the webpack.mix.js configuration first. If not, the user really doesn't know why the plugin doesn't work!

I think the idea of the asset path setting is addressing this issue (to be able to use mix.setPublicPath()), but it's misleading to the user. It looks like this is simply to shorten the asset file path for the Twig function mix() only.

It should be mentioned that you have to set the mix public path in your mix config exactly like this ... or there should be an additional path setting for the manifest file!

Also configuring via a php file in config/ (as is common with other plugins) would be nice.

BTW: is the public path setting really necessary? Craft offers this information internally imho.