@@ -46,8 +46,8 @@ const setupTranspileModules = () => {
...listPrefixedPackages(['remark-', 'rehype-', 'hast-', 'mdast-', 'micromark-', 'unist-']),
];
- logger.info('{bold:Listing scoped packages for transpiling:}');
- logger.unprefixed('info', `{grey:${JSON.stringify(packages, null, 2)}}`);
+ // logger.info('{bold:Listing scoped packages for transpiling:}');
+ // logger.unprefixed('info', `{grey:${JSON.stringify(packages, null, 2)}}`);
return require('next-transpile-modules')(packages);
};
@@ -418,20 +418,21 @@ Crowi.prototype.getTokens = function() {
Crowi.prototype.start = async function() {
const dev = process.env.NODE_ENV !== 'production';
- this.nextApp = next({ dev });
+ await this.init();
+ await this.buildServer();
+
+ // setup Next.js
+ this.nextApp = next({ dev });
await this.nextApp.prepare();
- // init CrowiDev
+ // setup CrowiDev
if (dev) {
const CrowiDev = require('./dev');
this.crowiDev = new CrowiDev(this);
this.crowiDev.init();
}
- await this.init();
- await this.buildServer();
-
const { express, configManager } = this;
const app = (this.node_env === 'development') ? this.crowiDev.setupServer(express) : express;