How to use the @angular/tsc-wrapped.NgcCliOptions function in @angular/tsc-wrapped

To help you get started, we’ve selected a few @angular/tsc-wrapped 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 JuanDelgadillo / angular2-pokedex / vendors / @angular / compiler-cli / src / main.js View on Github external
#!/usr/bin/env node
"use strict";
require('reflect-metadata');
var tsc = require('@angular/tsc-wrapped');
var codegen_1 = require('./codegen');
function codegen(ngOptions, cliOptions, program, host) {
    return codegen_1.CodeGenerator.create(ngOptions, cliOptions, program, host).codegen();
}
// CLI entry point
if (require.main === module) {
    var args = require('minimist')(process.argv.slice(2));
    var project = args.p || args.project || '.';
    var cliOptions = new tsc.NgcCliOptions(args);
    tsc.main(project, cliOptions, codegen).then(function (exitCode) { return process.exit(exitCode); }).catch(function (e) {
        console.error(e.stack);
        console.error('Compilation failed');
        process.exit(1);
    });
}
//# sourceMappingURL=main.js.map
github Promact / md2 / libs / @angular / compiler-cli / src / main.js View on Github external
function main(args, consoleError) {
    if (consoleError === void 0) { consoleError = console.error; }
    var project = args.p || args.project || '.';
    var cliOptions = new tsc.NgcCliOptions(args);
    return tsc.main(project, cliOptions, codegen).then(function () { return 0; }).catch(function (e) {
        if (e instanceof tsc.UserError || e instanceof compiler_1.SyntaxError) {
            consoleError(e.message);
            return Promise.resolve(1);
        }
        else {
            consoleError(e.stack);
            consoleError('Compilation failed');
            return Promise.resolve(1);
        }
    });
}
exports.main = main;
github bfwg / angular-spring-starter / frontend / node_modules / @angular / compiler-cli / src / main.js View on Github external
function main(args, consoleError) {
    if (consoleError === void 0) { consoleError = console.error; }
    var project = args.p || args.project || '.';
    var cliOptions = new tsc.NgcCliOptions(args);
    return tsc.main(project, cliOptions, codegen).then(function () { return 0; }).catch(function (e) {
        if (e instanceof tsc.UserError || compiler_1.isSyntaxError(e)) {
            consoleError(e.message);
            return Promise.resolve(1);
        }
        else {
            consoleError(e.stack);
            consoleError('Compilation failed');
            return Promise.resolve(1);
        }
    });
}
exports.main = main;
github angular / angular / packages / compiler-cli / src / main.ts View on Github external
function disabledTransformerPipelineNgcMain(
    args: any, consoleError: (s: string) => void = console.error): Promise {
  const cliOptions = new tsc.NgcCliOptions(args);
  const project = args.p || args.project || '.';
  return tsc.main(project, cliOptions, disabledTransformerPipelineCodegen)
      .then(() => 0)
      .catch(e => {
        if (e instanceof tsc.UserError || isSyntaxError(e)) {
          consoleError(e.message);
        } else {
          consoleError(e.stack);
        }
        return Promise.resolve(1);
      });
}
github VadimDez / ng2-pdf-viewer / build / lib / @angular / compiler-cli / src / main.js View on Github external
function main(args, consoleError) {
    if (consoleError === void 0) { consoleError = console.error; }
    var project = args.p || args.project || '.';
    var cliOptions = new tsc.NgcCliOptions(args);
    return tsc.main(project, cliOptions, codegen).then(function () { return 0; }).catch(function (e) {
        if (e instanceof tsc.UserError || compiler_1.isSyntaxError(e)) {
            consoleError(e.message);
            return Promise.resolve(1);
        }
        else {
            consoleError(e.stack);
            consoleError('Compilation failed');
            return Promise.resolve(1);
        }
    });
}
exports.main = main;
github bleenco / ng2-datepicker / scripts / lib / build.ts View on Github external
return Observable.create(observer => {
      let start: Date = new Date();
      const cliOptions = new tsc.NgcCliOptions({});
      spinner.start('Building...');
      tsc.main(path.resolve(__dirname, `../../${config}`), cliOptions, this.codegen)
      .then(() => {
        let time: number = new Date().getTime() - start.getTime();
        spinner.stop();
        observer.next(`${chalk.green('✔')} AoT Build Time: ${timeHuman(time)}`);
        observer.complete();
      })
      .catch(err => {
        observer.next(chalk.red(`✖ Compile error: ${err}`));
        observer.error();
      });
    });
  }
github rangle / angular-ssr / source / application / compiler / compiler-ng.ts View on Github external
export const compileTemplates = async (options: CompileOptions, program: Program, compilerHost: TsCompilerHost): Promise<[TsCompilerHost, Array]> => {
  const hostContext = new NodeCompilerHostContext();

  const ngCompiler = compilerFactory(program, options.angular, hostContext);

  const cli = new NgcCliOptions({
    i18nFormat: null,
    i18nFile: null,
    locale: null,
    basePath: options.angular.basePath
  });

  const generatedModules = await generateAngularCode(program, ngCompiler, compilerHost, cli);

  const metadataWriter = new MetadataWriterHost(compilerHost, options.angular);
  metadataWriter.writeFile = compilerHost.writeFile;

  return [metadataWriter, generatedModules];
};
github rangle / angular-ssr / source / application / compiler / program.ts View on Github external
private async generateTemplates(): Promise<[CompilerHost, Array]> {
    const hostContext = new NodeCompilerHostContext();

    const compiler = this.compilerFactory(hostContext);

    const cli = new NgcCliOptions({
      i18nFormat: null,
      i18nFile: null,
      locale: null,
      basePath: this.ng.basePath
    });

    const generatedModules = await this.generateTemplateCode(compiler, cli);

    const metadataWriter = new MetadataWriterHost(this.compilerHost, this.ng, true);

    return [metadataWriter, generatedModules];
  }