yeoman/grunt-usemin

usemin not using revisioned file (filerev) in block

Opened this issue · 3 comments

Hi,

I am having an issue replacing minified css file with revisioned one.
Note: my revisioned file is fully created in dist/public/css/styles-all.min.8e0e07d1.css

This is my grunt config file:

useminPrepare: {
    html: [
        'dist/resources/views/layouts/master.blade.php'
    ]
},
usemin: {
    html: [
        'dist/resources/views/layouts/master.blade.php'
    ],
    options: {
        assetsDirs: ['dist/public/css', 'dist']
    }
},

And this is my block in html file:

<!-- build:css {/- url /}/css/styles-all.min.css -->
<link href="<?php echo URL::to('/css/bootstrap.css'); ?>" rel="stylesheet" media="screen" />
<link href="<?php echo URL::to('/css/custom-styles.css'); ?>" rel="stylesheet" media="screen" />
<link href="<?php echo URL::to('/css/custom-spinner.css'); ?>" rel="stylesheet" media="screen" />
<link href="<?php echo URL::to('/css/datepicker.css'); ?>" rel="stylesheet" media="screen" />
<!-- endbuild -->

Where {/- url /} is variable used with grunt template, take it as http://someurl.com

My output is:

<link rel="stylesheet" href="http://someurl.com/css/styles-all.min.css" media="screen">

but it should be:

<link rel="stylesheet" href="http://someurl.com/css/styles-all.min.8e0e07d1.css" media="screen"> 

If I use

<!-- build:css styles-all.min.css -->

build goes okay but I am losing full URL then.

Any help please?

Why do you need the full url. usually if you have a full url you are referencing some external file

I can drop the full url but this is not working even with prefixed folder which I need to use

<!-- build:css css/styles-all.min.css -->

I thought you said it was working in the last line of your original post