mirror of
https://github.com/strapi/strapi.git
synced 2025-11-01 10:23:34 +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 path = require('path');
|
||||
const { EventEmitter } = require('events');
|
||||
const fse = require('fs-extra');
|
||||
const Koa = require('koa');
|
||||
const _ = require('lodash');
|
||||
const { logger, models } = require('strapi-utils');
|
||||
@ -102,6 +103,17 @@ class Strapi extends EventEmitter {
|
||||
this.fs = createStrapiFs(this);
|
||||
}
|
||||
|
||||
requireProjectBootstrap() {
|
||||
const bootstrapPath = path.resolve(
|
||||
this.dir,
|
||||
'config/functions/bootstrap.js'
|
||||
);
|
||||
|
||||
if (fse.existsSync(bootstrapPath)) {
|
||||
require(bootstrapPath);
|
||||
}
|
||||
}
|
||||
|
||||
async start(cb) {
|
||||
try {
|
||||
// Emit starting event.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user