I'm trying to use Elixir's version() method with my 'public' folder being public_html (instead of the default 'public' method).
I version my css file, which produces a build folder with the manifest inside public_html
elixir.config.cssOutput = 'public_html/css';
elixir.config.jsOutput = 'public_html/js';
elixir(function(mix) {
mix.styles([
'vendor/normalize.css',
'app.css'
], null, 'public_html/css');
mix.version('public_html/css/all.css');
});
In my blade template I use
<link href="{{ elixir("css/all.css") }}" rel="stylesheet">
Problem is the elixir function searches in 'public/build' folder. How can I change this so it searches public_html folder?
Thank you in advance
You forgot to overwrite your publicDir folder in the gulpfile.js
file, this points the build
folder to the correct location which is used by elixir to determine the version hash.
elixir.config.publicDir = 'public_html';
After you did that you must overwrite your public_path in Laravel, the recommended way for Laravel 5 is to go to the index.php
in your public folder:
Underneath
$app = require_once __DIR__.'/../bootstrap/app.php';
Add
// set the public path to this directory
$app->bind('path.public', function() {
return __DIR__;
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With