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