in config/wdl-workspace-routes-plugin.js [11:35]
apply(compiler) {
compiler.hooks.emit.tapAsync(
'WDLWorkspaceRoutesPlugin',
(compilation, callback) => {
console.log('Generating `routes.json`...');
const routesJson = this.buildRoutesObject();
if (routesJson) {
console.log(JSON.stringify(routesJson, null, ' '));
const content = JSON.stringify(routesJson);
compilation.assets['routes.json'] = {
source: function () {
return content;
},
size: function () {
return content.length;
}
};
console.log('`routes.json` generated.');
} else {
console.log(chalk.yellow('Generation of `routes.json` skipped'));
}
callback();
}
)
}