[TASK] Add cache breaker as variable and scss
This commit is contained in:
parent
7d7fc1ac5a
commit
3c5044f137
@ -5,3 +5,5 @@ rules:
|
||||
no-vendor-prefixes: 0
|
||||
# Needed for old 'display: -vendor-prefix-property' for higher browser-support
|
||||
no-duplicate-properties: 0
|
||||
# Needed for unique-id()
|
||||
empty-args: 0
|
||||
|
@ -262,6 +262,12 @@ Example for `supportedLocale`:
|
||||
"de"
|
||||
]
|
||||
|
||||
## cacheBreaker (string)
|
||||
|
||||
Will be replaced in every build to avoid missing or outdated language strings, because language.json isn't up to date.
|
||||
|
||||
_Fixed value (y0z)._
|
||||
|
||||
## Sponsoring / Supporting
|
||||
- [BrowserStack](https://www.browserstack.com/) for providing a awesome testing service for hundreds of browsers
|
||||
- [Travis CI](https://travis-ci.org/) for testing every push and pull request
|
||||
|
@ -1,13 +1,15 @@
|
||||
// Needed for standalone scss
|
||||
// @import 'icon-mixin';
|
||||
|
||||
$cache-breaker: unique-id();
|
||||
|
||||
@font-face {
|
||||
font-family: 'ionicons';
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
src: url('fonts/icon.woff2') format('woff2'),
|
||||
url('fonts/icon.woff') format('woff'),
|
||||
url('fonts/icon.ttf') format('truetype');
|
||||
src: url('fonts/icon.woff2?rel=#{$cache-breaker}') format('woff2'),
|
||||
url('fonts/icon.woff?rel=#{$cache-breaker}') format('woff'),
|
||||
url('fonts/icon.ttf?rel=#{$cache-breaker}') format('truetype');
|
||||
}
|
||||
|
||||
[class^='ion-'], [class*=' ion-'] {
|
||||
|
@ -114,5 +114,6 @@
|
||||
"supportedLocale": [
|
||||
"en",
|
||||
"de"
|
||||
]
|
||||
],
|
||||
"cacheBreaker": "y0z"
|
||||
}
|
||||
|
@ -178,7 +178,7 @@ define(['polyglot', 'moment', 'router', 'leaflet', 'gui', 'helper'],
|
||||
});
|
||||
|
||||
window._ = new Polyglot({locale: locale, allowMissing: true});
|
||||
helper.getJSON('locale/' + _.locale() + '.json').then(setTranslation);
|
||||
helper.getJSON('locale/' + _.locale() + '.json?' + config.cacheBreaker).then(setTranslation);
|
||||
|
||||
var router = new Router();
|
||||
|
||||
|
@ -149,13 +149,22 @@ module.exports = function exports(grunt) {
|
||||
}
|
||||
},
|
||||
cachebreaker: {
|
||||
default: {
|
||||
js: {
|
||||
options: {
|
||||
match: ['app.js']
|
||||
},
|
||||
files: {
|
||||
src: ['build/index.html']
|
||||
}
|
||||
},
|
||||
variable: {
|
||||
options: {
|
||||
match: ['y*z'],
|
||||
position: 'overwrite'
|
||||
},
|
||||
files: {
|
||||
src: ['build/config.json']
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user