mirror of
https://github.com/element-hq/element-web.git
synced 2024-12-18 12:22:56 +03:00
Merge pull request #2658 from matrix-org/bwindels/moarcachebustin
Cache-bust languages.json with file-loader
This commit is contained in:
commit
6455334bd0
3 changed files with 7 additions and 2 deletions
|
@ -15,6 +15,9 @@ module.exports = {
|
||||||
"flowtype",
|
"flowtype",
|
||||||
"babel"
|
"babel"
|
||||||
],
|
],
|
||||||
|
globals: {
|
||||||
|
LANGUAGES_FILE: "readonly",
|
||||||
|
},
|
||||||
env: {
|
env: {
|
||||||
es6: true,
|
es6: true,
|
||||||
},
|
},
|
||||||
|
|
|
@ -23,5 +23,5 @@ ln -s "$REACT_SDK_DIR/node_modules/matrix-js-sdk" node_modules/matrix-js-sdk
|
||||||
rm -r node_modules/matrix-react-sdk
|
rm -r node_modules/matrix-react-sdk
|
||||||
ln -s "$REACT_SDK_DIR" node_modules/matrix-react-sdk
|
ln -s "$REACT_SDK_DIR" node_modules/matrix-react-sdk
|
||||||
|
|
||||||
npm run build
|
RIOT_LANGUAGES_FILE="../riot-web/webapp/i18n/languages.json" npm run build
|
||||||
popd
|
popd
|
||||||
|
|
|
@ -338,8 +338,10 @@ export function getCurrentLanguage() {
|
||||||
|
|
||||||
function getLangsJson() {
|
function getLangsJson() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
|
// LANGUAGES_FILE is a webpack compile-time define, see webpack config
|
||||||
|
const url = (typeof LANGUAGES_FILE === "string") ? require(LANGUAGES_FILE) : (i18nFolder + 'languages.json');
|
||||||
request(
|
request(
|
||||||
{ method: "GET", url: i18nFolder + 'languages.json' },
|
{ method: "GET", url },
|
||||||
(err, response, body) => {
|
(err, response, body) => {
|
||||||
if (err || response.status < 200 || response.status >= 300) {
|
if (err || response.status < 200 || response.status >= 300) {
|
||||||
reject({err: err, response: response});
|
reject({err: err, response: response});
|
||||||
|
|
Loading…
Reference in a new issue