yeoman / grunt-usemin

[UNMAINTAINED] Replaces references to non-optimized scripts or stylesheets into a set of HTML files (or any templates/views)
BSD 2-Clause "Simplified" License
1.22k stars 338 forks source link

usemin not using revisioned file (filerev) in block #583

Open ZigaVukcevicDev opened 9 years ago

ZigaVukcevicDev commented 9 years ago

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?

eddiemonge commented 9 years ago

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

ZigaVukcevicDev commented 9 years ago

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 -->

eddiemonge commented 9 years ago

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