Closed ThomasTr closed 4 years ago
This is my first time with this specific plugin, so I installed 1.6.0, but could never get the tags in my layout file to bust correctly. Once I installed 1.4.1, they worked great.
My Config:
cacheBust: {
addTimeStamp: {
options: {
assets: ["Content/css/main.1.0.css", "Content/css/main.2.0.css", "app/compiled.min.js"]
},
files: [{
src: ["Views/Shared/_Layout.cshtml"]
}]
}
}
My Template:
<html>
<head>
<link rel="stylesheet" href="~/Content/css/main.1.0.min.css" />
<link rel="stylesheet" href="~/Content/css/main.2.0.min.css" />
</head>
<body>
<script src="~/app/compiled.min.js"></script>
</body>
Nothing in the template got replaced with the new hashed file names. I wonder if it has to do with my layout using relative paths?
I had the same experience as @ThomasTr.
Gruntfile.js
cacheBust: {
options: {
jsonOutput: true,
baseDir: 'htdocs/',
assets: ['js/**']
},
taskName: {
src: ['templates/Default/engine/Default/preferences.php']
}
}
Where preferences.php contains the following line:
<script type="text/javascript" src="js/colorpicker.js"></script>
With version 1.6.0, I see the following output:
Running "cacheBust:taskName" (cacheBust) task
>> 1 file busted.
but the preferences.php file is unchanged. However, when I use version 1.4.1 instead, I see:
Running "cacheBust:taskName" (cacheBust) task
>> Busted: templates/Default/engine/Default/preferences.php
And the file is changed to
<script type="text/javascript" src="js/colorpicker.eb1ad786c7a2e593.js"></script>
Thank you to those who pointed me to version 1.4.1, but I am also curious: what has changed in 1.6.0, or what am I doing wrong here? I was pulling my hair out trying to figure out my mistake.
Note to anyone watching that this is not fixed in release 1.7.0.
The Cachebusting for the files works, but the template File gets no more busted.
The cache busting part from my gruntfile:
The tags to be busted of my layout.html.twig file are:
Reverted to 1.4.1 and it work again. Are there any relevant changes between these versions?