mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 18:33:55 +00:00
Change autoReload config
This commit is contained in:
parent
3d7b26df8f
commit
19d0f17efb
@ -30,10 +30,10 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"cross-env": "^5.0.5",
|
||||
"eslint": "^4.6.1",
|
||||
"eslint": "^4.7.0",
|
||||
"eslint-config-airbnb": "^15.1.0",
|
||||
"eslint-config-airbnb-base": "^11.3.2",
|
||||
"eslint-config-prettier": "^2.4.0",
|
||||
"eslint-config-prettier": "^2.5.0",
|
||||
"eslint-import-resolver-webpack": "^0.8.3",
|
||||
"eslint-plugin-babel": "^4.1.2",
|
||||
"eslint-plugin-import": "^2.7.0",
|
||||
@ -44,10 +44,10 @@
|
||||
"html-loader": "^0.4.3",
|
||||
"html-webpack-plugin": "^2.22.0",
|
||||
"plop": "^1.8.1",
|
||||
"prettier": "^1.6.1",
|
||||
"rimraf": "^2.6.1",
|
||||
"prettier": "^1.7.0",
|
||||
"rimraf": "^2.6.2",
|
||||
"strapi-helper-plugin": "3.0.0-alpha.5.5",
|
||||
"webpack": "^3.5.6"
|
||||
"webpack": "^3.6.0"
|
||||
},
|
||||
"author": {
|
||||
"name": "Strapi",
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
{
|
||||
"host": "localhost",
|
||||
"port": 1337,
|
||||
"autoReload": true,
|
||||
"autoReload": {
|
||||
"enabled": true
|
||||
},
|
||||
"cron": {
|
||||
"enabled": false
|
||||
}
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
{
|
||||
"host": "localhost",
|
||||
"port": 1337,
|
||||
"autoReload": false,
|
||||
"autoReload": {
|
||||
"enabled": false
|
||||
},
|
||||
"cron": {
|
||||
"enabled": false
|
||||
}
|
||||
|
||||
@ -1,7 +1,9 @@
|
||||
{
|
||||
"host": "localhost",
|
||||
"port": 1337,
|
||||
"autoReload": true,
|
||||
"autoReload": {
|
||||
"enabled": true
|
||||
},
|
||||
"cron": {
|
||||
"enabled": false
|
||||
}
|
||||
|
||||
@ -48,10 +48,10 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"cross-env": "^5.0.5",
|
||||
"eslint": "^4.6.1",
|
||||
"eslint": "^4.7.0",
|
||||
"eslint-config-airbnb": "^15.1.0",
|
||||
"eslint-config-airbnb-base": "^11.3.2",
|
||||
"eslint-config-prettier": "^2.4.0",
|
||||
"eslint-config-prettier": "^2.5.0",
|
||||
"eslint-import-resolver-webpack": "^0.8.3",
|
||||
"eslint-plugin-babel": "^4.1.2",
|
||||
"eslint-plugin-import": "^2.7.0",
|
||||
@ -59,9 +59,9 @@
|
||||
"eslint-plugin-react": "^7.3.0",
|
||||
"eslint-plugin-redux-saga": "^0.4.0",
|
||||
"plop": "^1.8.1",
|
||||
"prettier": "^1.6.1",
|
||||
"rimraf": "^2.6.1",
|
||||
"prettier": "^1.7.0",
|
||||
"rimraf": "^2.6.2",
|
||||
"strapi-helper-plugin": "3.0.0-alpha.5.5",
|
||||
"webpack": "^3.5.6"
|
||||
"webpack": "^3.6.0"
|
||||
}
|
||||
}
|
||||
@ -35,10 +35,10 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"cross-env": "^5.0.5",
|
||||
"eslint": "^4.6.1",
|
||||
"eslint": "^4.7.0",
|
||||
"eslint-config-airbnb": "^15.1.0",
|
||||
"eslint-config-airbnb-base": "^11.3.2",
|
||||
"eslint-config-prettier": "^2.4.0",
|
||||
"eslint-config-prettier": "^2.5.0",
|
||||
"eslint-import-resolver-webpack": "^0.8.3",
|
||||
"eslint-plugin-babel": "^4.1.2",
|
||||
"eslint-plugin-import": "^2.7.0",
|
||||
@ -46,10 +46,10 @@
|
||||
"eslint-plugin-react": "^7.3.0",
|
||||
"eslint-plugin-redux-saga": "^0.4.0",
|
||||
"plop": "^1.8.1",
|
||||
"prettier": "^1.6.1",
|
||||
"rimraf": "^2.6.1",
|
||||
"prettier": "^1.7.0",
|
||||
"rimraf": "^2.6.2",
|
||||
"strapi-helper-plugin": "3.0.0-alpha.5.5",
|
||||
"webpack": "^3.5.6"
|
||||
"webpack": "^3.6.0"
|
||||
},
|
||||
"author": {
|
||||
"name": "Strapi team",
|
||||
|
||||
@ -50,7 +50,7 @@ module.exports = function() {
|
||||
'server.json'
|
||||
));
|
||||
|
||||
if (process.env.NODE_ENV === 'development' && server.autoReload === true) {
|
||||
if (process.env.NODE_ENV === 'development' && _.get(server, 'autoReload.enabled') === true) {
|
||||
const restart = path => {
|
||||
if (strapi.reload.isWatching && cluster.isWorker && !strapi.reload.isReloading) {
|
||||
strapi.reload.isReloading = true;
|
||||
|
||||
@ -138,7 +138,7 @@ class Strapi extends EventEmitter {
|
||||
// Destroy server and available connections.
|
||||
this.server.destroy();
|
||||
|
||||
if (cluster.isWorker && process.env.NODE_ENV === 'development' && get(this.config, 'currentEnvironment.server.autoReload') === true) process.send('stop');
|
||||
if (cluster.isWorker && process.env.NODE_ENV === 'development' && get(this.config, 'currentEnvironment.server.autoReload.enabled') === true) process.send('stop');
|
||||
|
||||
// Kill process.
|
||||
process.exit(0);
|
||||
@ -173,7 +173,7 @@ class Strapi extends EventEmitter {
|
||||
|
||||
reload() {
|
||||
const reload = function() {
|
||||
if (cluster.isWorker && process.env.NODE_ENV === 'development' && get(this.config, 'currentEnvironment.server.autoReload') === true) process.send('reload');
|
||||
if (cluster.isWorker && process.env.NODE_ENV === 'development' && get(this.config, 'currentEnvironment.server.autoReload.enabled') === true) process.send('reload');
|
||||
};
|
||||
|
||||
reload.isReloading = false;
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
module.exports = function reload() {
|
||||
try {
|
||||
const reload = function() {
|
||||
if (cluster.isWorker && process.env.NODE_ENV === 'development' && get(this.config, 'currentEnvironment.server.autoReload') === true) process.send('reload');
|
||||
if (cluster.isWorker && process.env.NODE_ENV === 'development' && get(this.config, 'currentEnvironment.server.autoReload.enabled') === true) process.send('reload');
|
||||
};
|
||||
|
||||
reload.isReloading = false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user