How to use the midway-bin.BuildCommand function in midway-bin

To help you get started, we’ve selected a few midway-bin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github midwayjs / midway-faas / packages / serverless-midway-plugin / src / provider / default / package / index.ts View on Github external
'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)`);
      },

midway-bin

Midway Command Tools

MIT
Latest version published 4 years ago

Package Health Score

64 / 100
Full package analysis