build.js 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. exports.CustomBuildRunner = void 0;
  4. const build_1 = require("../../build");
  5. const color_1 = require("../../color");
  6. const errors_1 = require("../../errors");
  7. class CustomBuildRunner extends build_1.BuildRunner {
  8. constructor(e) {
  9. super();
  10. this.e = e;
  11. }
  12. async getCommandMetadata() {
  13. return {};
  14. }
  15. createOptionsFromCommandLine(inputs, options) {
  16. const baseOptions = super.createBaseOptionsFromCommandLine(inputs, options);
  17. return {
  18. ...baseOptions,
  19. type: 'custom',
  20. };
  21. }
  22. async buildProject(options) {
  23. const cli = this.getPkgManagerBuildCLI();
  24. if (!await cli.resolveScript()) {
  25. throw new errors_1.RunnerException(`Cannot perform build.\n` +
  26. `Since you're using the ${(0, color_1.strong)('custom')} project type, you must provide the ${(0, color_1.input)(cli.script)} npm script so the Ionic CLI can build your project.`);
  27. }
  28. await cli.build(options);
  29. }
  30. }
  31. exports.CustomBuildRunner = CustomBuildRunner;