mirror of
https://github.com/strapi/strapi.git
synced 2025-11-09 22:59:14 +00:00
Merge pull request #3453 from strapi/tech/require-bootstrap-file-first
Requiring bootstrap.js before config loading
This commit is contained in:
commit
0fc7b72c42
@ -4,6 +4,7 @@
|
|||||||
const http = require('http');
|
const http = require('http');
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const { EventEmitter } = require('events');
|
const { EventEmitter } = require('events');
|
||||||
|
const fse = require('fs-extra');
|
||||||
const Koa = require('koa');
|
const Koa = require('koa');
|
||||||
const _ = require('lodash');
|
const _ = require('lodash');
|
||||||
const { logger, models } = require('strapi-utils');
|
const { logger, models } = require('strapi-utils');
|
||||||
@ -102,6 +103,17 @@ class Strapi extends EventEmitter {
|
|||||||
this.fs = createStrapiFs(this);
|
this.fs = createStrapiFs(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
requireProjectBootstrap() {
|
||||||
|
const bootstrapPath = path.resolve(
|
||||||
|
this.dir,
|
||||||
|
'config/functions/bootstrap.js'
|
||||||
|
);
|
||||||
|
|
||||||
|
if (fse.existsSync(bootstrapPath)) {
|
||||||
|
require(bootstrapPath);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async start(cb) {
|
async start(cb) {
|
||||||
try {
|
try {
|
||||||
// Emit starting event.
|
// Emit starting event.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user