Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'package:midway-compileFunctions': async () => { // 构建midway faas
this.serverless.cli.log('Building Midway FaaS directory files...');
if (!this.isTsDir) {
this.serverless.cli.log(' - Not found tsconfig.json and skip build');
return;
}
const timeTick = this.tick();
if (this.options.ncc) {
this.serverless.cli.log(' - Using single file build mode');
// await buildByNcc();
} else {
this.serverless.cli.log(' - Using tradition build mode');
const spinner = ora(' - Compiling Functions').start();
const builder = new BuildCommand();
const servicePath: string = this.midwayBuildPath;
await co(function* () {
yield builder.run({
cwd: servicePath,
argv: {
clean: true,
project: 'tsconfig.json',
srcDir: 'src'
}
});
});
await remove(join(this.midwayBuildPath, 'src'));
spinner.stop();
}
this.serverless.cli.log(` - Build Midway FaaS complete (${timeTick()}ms)`);
},