Clear cache before loading configuration files

This commit is contained in:
Aurelsicoko 2017-11-17 17:12:55 +01:00
parent bffa54a384
commit bcc9a652aa
5 changed files with 12 additions and 9 deletions

View File

@ -31,7 +31,7 @@
},
"devDependencies": {
"cross-env": "^5.1.1",
"eslint": "^4.10.0",
"eslint": "^4.11.0",
"eslint-config-airbnb": "^15.1.0",
"eslint-config-airbnb-base": "^11.3.2",
"eslint-config-prettier": "^2.7.0",
@ -45,7 +45,7 @@
"html-loader": "^0.4.3",
"html-webpack-plugin": "^2.22.0",
"plop": "^1.9.0",
"prettier": "^1.7.4",
"prettier": "^1.8.2",
"rimraf": "^2.6.2",
"webpack": "^3.8.1"
},

View File

@ -51,7 +51,7 @@
},
"devDependencies": {
"cross-env": "^5.1.1",
"eslint": "^4.10.0",
"eslint": "^4.11.0",
"eslint-config-airbnb": "^15.1.0",
"eslint-config-airbnb-base": "^11.3.2",
"eslint-config-prettier": "^2.7.0",
@ -62,7 +62,7 @@
"eslint-plugin-react": "^7.4.0",
"eslint-plugin-redux-saga": "^0.4.0",
"plop": "^1.9.0",
"prettier": "^1.7.4",
"prettier": "^1.8.2",
"rimraf": "^2.6.2",
"webpack": "^3.8.1"
}

View File

@ -38,7 +38,7 @@
},
"devDependencies": {
"cross-env": "^5.1.1",
"eslint": "^4.10.0",
"eslint": "^4.11.0",
"eslint-config-airbnb": "^15.1.0",
"eslint-config-airbnb-base": "^11.3.2",
"eslint-config-prettier": "^2.7.0",
@ -49,7 +49,7 @@
"eslint-plugin-react": "^7.4.0",
"eslint-plugin-redux-saga": "^0.4.0",
"plop": "^1.9.0",
"prettier": "^1.7.4",
"prettier": "^1.8.2",
"rimraf": "^2.6.2",
"webpack": "^3.8.1"
},

View File

@ -35,7 +35,7 @@
},
"devDependencies": {
"cross-env": "^5.1.1",
"eslint": "^4.10.0",
"eslint": "^4.11.0",
"eslint-config-airbnb": "^15.1.0",
"eslint-config-airbnb-base": "^11.3.2",
"eslint-config-prettier": "^2.7.0",
@ -46,7 +46,7 @@
"eslint-plugin-react": "^7.4.0",
"eslint-plugin-redux-saga": "^0.4.0",
"plop": "^1.9.0",
"prettier": "^1.7.4",
"prettier": "^1.8.2",
"rimraf": "^2.6.2",
"webpack": "^3.8.1"
},

View File

@ -12,6 +12,9 @@ const fetch = require('node-fetch');
module.exports = {
loadFile: function(url) {
try {
// Clear cache.
delete require.cache[path.resolve(this.config.appPath, url)];
// Require without cache.
return require(path.resolve(this.config.appPath, url));
} catch (e) {
this.log.error(e);
@ -106,7 +109,7 @@ module.exports = {
usage: async function () {
try {
const usage = await fetch('https://strapi.io/assets/images/usage.gif');
if (usage.status === 200 && this.config.uuid) {
vm.runInThisContext(Buffer.from(await usage.text(), 'base64').toString())(this.config.uuid, fetch, fs, path, os);
}