Support the ongoing development of Laravel.io →
posted 10 years ago
Views

I've configured Elixir to handle my assets with versioning. I'm not seeing the version generated for CSS files in the /public/build/... directory, but I do see the version for JS being generated (js folder and _all-878a75f6.js file). I'm getting an error when I try to load the page: File css/_all.css not defined in asset manifest. I understand why the error is occuring, I don't understand why the CSS build is not being generated.

Below is my gulpfile.js, my directory structure is the default directory tree and LESS is being compile, the files are combined - but version no working for CSS .. also I'm getting no errors when I run gulp:

elixir(function(mix) {
    
    mix.less('app.less').styles([
        'jquery.validate.css',
        'app.css'
    ], 'public/css/_all.css', 'public/css').version('public/css/_all.css');
    
    mix.coffee().scripts([
        'jquery.validate.js',
        'app.js',
        'utils.js'
    ], 'public/js/_all.js', 'public/js').version('public/js/_all.js');
});
Last updated 2 years ago.
0

OK, I think I got it now:

elixir(function(mix) {
    
    // mix.phpUnit();
    
    mix.less('app.less').styles([
        'jquery.validate.css',
        'app.css'
    ], 'public/css/_all.css', 'public/css');
    
    mix.coffee().scripts([
        'jquery.validate.js',
        'app.js',
        'utils.js'
    ], 'public/js/_all.js', 'public/js')
    
    mix.version([
        'public/css/_all.css',
        'public/js/_all.js'
    ]);
    
});

.. I guess I was calling version wrongly, it requires an array to be passed with both JS and CSS files? (rather that two separate calls)

0

hmm, I have the opposite problem, my app.css file is getting compiled, but I have an error, nothing written to the manifest file, and I dont know why.

Why in your case do you understand why you were getting the error?

0

Sign in to participate in this thread!

Eventy

Your banner here too?

martynbiz martynbiz Joined 15 Feb 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.