2727 * https://github.com/Zolmeister/grunt-sails-linker
2828 *
2929 */
30+
31+ var version = require ( '../../package.json' ) . version
32+
3033module . exports = function ( grunt ) {
3134
3235 grunt . config . set ( 'sails-linker' , {
3336 devJs : {
3437 options : {
3538 startTag : '<!--SCRIPTS-->' ,
3639 endTag : '<!--SCRIPTS END-->' ,
37- fileTmpl : '<script src="%s"></script>' ,
40+ fileTmpl : '<script src="%s?r=' + version + ' "></script>',
3841 appRoot : '.tmp/public'
3942 } ,
4043 files : {
@@ -48,7 +51,7 @@ module.exports = function(grunt) {
4851 options : {
4952 startTag : '<!--SCRIPTS-->' ,
5053 endTag : '<!--SCRIPTS END-->' ,
51- fileTmpl : '<script src="%s"></script>' ,
54+ fileTmpl : '<script src="%s?r=' + version + ' "></script>',
5255 appRoot : '.tmp/public' ,
5356 relative : true
5457 } ,
@@ -63,7 +66,7 @@ module.exports = function(grunt) {
6366 options : {
6467 startTag : '<!--SCRIPTS-->' ,
6568 endTag : '<!--SCRIPTS END-->' ,
66- fileTmpl : '<script src="%s"></script>' ,
69+ fileTmpl : '<script src="%s?r=' + version + ' "></script>',
6770 appRoot : '.tmp/public'
6871 } ,
6972 files : {
@@ -77,7 +80,7 @@ module.exports = function(grunt) {
7780 options : {
7881 startTag : '<!--SCRIPTS-->' ,
7982 endTag : '<!--SCRIPTS END-->' ,
80- fileTmpl : '<script src="%s"></script>' ,
83+ fileTmpl : '<script src="%s?r=' + version + ' "></script>',
8184 appRoot : '.tmp/public' ,
8285 relative : true
8386 } ,
@@ -92,7 +95,7 @@ module.exports = function(grunt) {
9295 options : {
9396 startTag : '<!--STYLES-->' ,
9497 endTag : '<!--STYLES END-->' ,
95- fileTmpl : '<link rel="stylesheet" href="%s">' ,
98+ fileTmpl : '<link rel="stylesheet" href="%s?r=' + version + ' ">',
9699 appRoot : '.tmp/public'
97100 } ,
98101
@@ -107,7 +110,7 @@ module.exports = function(grunt) {
107110 options : {
108111 startTag : '<!--STYLES-->' ,
109112 endTag : '<!--STYLES END-->' ,
110- fileTmpl : '<link rel="stylesheet" href="%s">' ,
113+ fileTmpl : '<link rel="stylesheet" href="%s?r=' + version + ' ">',
111114 appRoot : '.tmp/public' ,
112115 relative : true
113116 } ,
@@ -123,7 +126,7 @@ module.exports = function(grunt) {
123126 options : {
124127 startTag : '<!--STYLES-->' ,
125128 endTag : '<!--STYLES END-->' ,
126- fileTmpl : '<link rel="stylesheet" href="%s">' ,
129+ fileTmpl : '<link rel="stylesheet" href="%s?r=' + version + ' ">',
127130 appRoot : '.tmp/public'
128131 } ,
129132 files : {
@@ -137,7 +140,7 @@ module.exports = function(grunt) {
137140 options : {
138141 startTag : '<!--STYLES-->' ,
139142 endTag : '<!--STYLES END-->' ,
140- fileTmpl : '<link rel="stylesheet" href="%s">' ,
143+ fileTmpl : '<link rel="stylesheet" href="%s?r=' + version + ' ">',
141144 appRoot : '.tmp/public' ,
142145 relative : true
143146 } ,
@@ -153,7 +156,7 @@ module.exports = function(grunt) {
153156 options : {
154157 startTag : '<!--TEMPLATES-->' ,
155158 endTag : '<!--TEMPLATES END-->' ,
156- fileTmpl : '<script type="text/javascript" src="%s"></script>' ,
159+ fileTmpl : '<script type="text/javascript" src="%s?r=' + version + ' "></script>',
157160 appRoot : '.tmp/public'
158161 } ,
159162 files : {
@@ -167,7 +170,7 @@ module.exports = function(grunt) {
167170 options : {
168171 startTag : '// SCRIPTS' ,
169172 endTag : '// SCRIPTS END' ,
170- fileTmpl : 'script(src="%s")' ,
173+ fileTmpl : 'script(src="%s?r=' + version + ' ")',
171174 appRoot : '.tmp/public'
172175 } ,
173176 files : {
@@ -179,7 +182,7 @@ module.exports = function(grunt) {
179182 options : {
180183 startTag : '// SCRIPTS' ,
181184 endTag : '// SCRIPTS END' ,
182- fileTmpl : 'script(src="%s")' ,
185+ fileTmpl : 'script(src="%s?r=' + version + ' ")',
183186 appRoot : '.tmp/public' ,
184187 relative : true
185188 } ,
@@ -192,7 +195,7 @@ module.exports = function(grunt) {
192195 options : {
193196 startTag : '// SCRIPTS' ,
194197 endTag : '// SCRIPTS END' ,
195- fileTmpl : 'script(src="%s")' ,
198+ fileTmpl : 'script(src="%s?r=' + version + ' ")',
196199 appRoot : '.tmp/public'
197200 } ,
198201 files : {
@@ -204,7 +207,7 @@ module.exports = function(grunt) {
204207 options : {
205208 startTag : '// SCRIPTS' ,
206209 endTag : '// SCRIPTS END' ,
207- fileTmpl : 'script(src="%s")' ,
210+ fileTmpl : 'script(src="%s?r=' + version + ' ")',
208211 appRoot : '.tmp/public' ,
209212 relative : true
210213 } ,
@@ -217,7 +220,7 @@ module.exports = function(grunt) {
217220 options : {
218221 startTag : '// STYLES' ,
219222 endTag : '// STYLES END' ,
220- fileTmpl : 'link(rel="stylesheet", href="%s")' ,
223+ fileTmpl : 'link(rel="stylesheet", href="%s?r=' + version + ' ")',
221224 appRoot : '.tmp/public'
222225 } ,
223226
@@ -230,7 +233,7 @@ module.exports = function(grunt) {
230233 options : {
231234 startTag : '// STYLES' ,
232235 endTag : '// STYLES END' ,
233- fileTmpl : 'link(rel="stylesheet", href="%s")' ,
236+ fileTmpl : 'link(rel="stylesheet", href="%s?r=' + version + ' ")',
234237 appRoot : '.tmp/public' ,
235238 relative : true
236239 } ,
@@ -244,7 +247,7 @@ module.exports = function(grunt) {
244247 options : {
245248 startTag : '// STYLES' ,
246249 endTag : '// STYLES END' ,
247- fileTmpl : 'link(rel="stylesheet", href="%s")' ,
250+ fileTmpl : 'link(rel="stylesheet", href="%s?r=' + version + ' ")',
248251 appRoot : '.tmp/public'
249252 } ,
250253 files : {
@@ -256,7 +259,7 @@ module.exports = function(grunt) {
256259 options : {
257260 startTag : '// STYLES' ,
258261 endTag : '// STYLES END' ,
259- fileTmpl : 'link(rel="stylesheet", href="%s")' ,
262+ fileTmpl : 'link(rel="stylesheet", href="%s?r=' + version + ' ")',
260263 appRoot : '.tmp/public' ,
261264 relative : true
262265 } ,
@@ -270,7 +273,7 @@ module.exports = function(grunt) {
270273 options : {
271274 startTag : '// TEMPLATES' ,
272275 endTag : '// TEMPLATES END' ,
273- fileTmpl : 'script(type="text/javascript", src="%s")' ,
276+ fileTmpl : 'script(type="text/javascript", src="%s?r=' + version + ' ")',
274277 appRoot : '.tmp/public'
275278 } ,
276279 files : {
0 commit comments