mister-bk / craft-plugin-mix

Helper plugin for Laravel Mix in Craft CMS templates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

version() hash not included in file path

bigskillet opened this issue · comments

Manifest contains:

{
    "/assets/main.js": "/assets/main.js?id=4201cd156b22ae18fa0a",
    "/assets/main.css": "/assets/main.css?id=d4c7912ff5280a471880"
}

Using <link rel="stylesheet" href="{{ mix('main.css') }}"> outputs <link rel="stylesheet" href="/assets/main.css"> with no hash.

What am I doing wrong?

Is the manifest located in the directory which is defined in the plugin settings?

The manifest should go in the public directory, correct?

What's inside your asset path setting?
From my understanding it looks after it inside the combination of both, the public and asset path defined in your mix settings.
Have you tried it inside your public/assets folder?
If yes the asset path setting in your mix plugin should say assets and the manifest should look something like this I think.

{
    "/main.js": "/main.js?id=4201cd156b22ae18fa0a",
    "/main.css": "/main.css?id=d4c7912ff5280a471880"
}

Ah, it's working now that I put / in the assets path. Here's my manifest:

{
    "/assets/main.js": "/assets/main.js?id=9f07326b951738c55067",
    "/assets/main.css": "/assets/main.css?id=c76cb4c1290a73484190"
}

I'm having this same issue. I have a config file:

return array(
	'*' => array(
		'publicPath' => 'public_html',
		'assetPath' => 'assets',
	),
);

and a mix-manifest.json file which is located at /public_html/assets:

{
    "/js/site.min.js": "/js/site.min.js?id=21169849ee6ff21c1d67",
    "/css/master.min.css": "/css/master.min.css?id=6a8cb615bc4690b994e7"
}

and when I output mix('css/master.min.css'), I get /assets/css/master.min.css. I've also tried updating my manifest to have /assets/ at the beginning of the path but get the same output.