How to use the @angular-devkit/build-angular/src/angular-cli-files/utilities/read-tsconfig.readTsconfig function in @angular-devkit/build-angular

To help you get started, we’ve selected a few @angular-devkit/build-angular 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 enten / udk / angular / lib / build / ng-devkit.ts View on Github external
...context,
      builder: {
        ...context.builder,
        builderName: 'browser',
      },
    },
    host,
    true,
  );

  const config = await applyWebpackPartialConfig(
    browserConfig,
    universalOptions.partialBrowserConfig as string,
  );

  const tsConfig = readTsconfig(browserOptions.tsConfig, context.workspaceRoot);
  const target = tsConfig.options.target || ScriptTarget.ES5;
  const buildBrowserFeatures = new BuildBrowserFeatures(projectRoot, target);
  const isDifferentialLoadingNeeded = buildBrowserFeatures.isDifferentialLoadingNeeded();
  const useBundleDownleveling = isDifferentialLoadingNeeded && !browserOptions.watch;

  if (target > ScriptTarget.ES2015 && isDifferentialLoadingNeeded) {
    context.logger.warn(tags.stripIndent`
      WARNING: Using differential loading with targets ES5 and ES2016 or higher may
      cause problems. Browsers with support for ES2015 will load the ES2016+ scripts
      referenced with script[type="module"] but they may not support ES2016+ syntax.
    `);
  }

  if (browserOptions.deleteOutputPath) {
    deleteOutputDir(
      context.workspaceRoot,
github just-jeb / electron-angular-native / custom-builders / src / custom-webpack / index.ts View on Github external
buildWebpackConfig(
    root: Path,
    projectRoot: Path,
    host: virtualFs.Host,
    options: NormalizedBrowserBuilderSchema,
  ) {
    let wco: WebpackConfigOptions;

    const tsConfigPath = getSystemPath(normalize(resolve(root, normalize(options.tsConfig))));
    const tsConfig = readTsconfig(tsConfigPath);

    const projectTs = requireProjectModule(getSystemPath(projectRoot), 'typescript') as typeof ts;

    const supportES2015 = tsConfig.options.target !== projectTs.ScriptTarget.ES3
      && tsConfig.options.target !== projectTs.ScriptTarget.ES5;

    wco = {
      root: getSystemPath(root),
      projectRoot: getSystemPath(projectRoot),
      buildOptions: options,
      tsConfig,
      tsConfigPath,
      supportES2015,
    };

    const webpackConfigs: {}[] = [
github enten / udk / angular / lib / build / ng-devkit.ts View on Github external
getServerConfig(wco),
      getStylesConfig(wco),
      getStatsConfig(wco),
      getAotConfig(wco),
    ],
  );

  setWebpackServerFileLoaderEmitFile(universalOptions, serverOptions, browserOptions, serverConfig);
  setWebpackServerExternals(universalOptions, serverConfig);

  const config = await applyWebpackPartialConfig(
    serverConfig,
    universalOptions.partialServerConfig as string,
  );

  const tsConfig = readTsconfig(serverOptions.tsConfig, context.workspaceRoot);
  const target = tsConfig.options.target || ScriptTarget.ES5;

  if (serverOptions.deleteOutputPath) {
    deleteOutputDir(
      context.workspaceRoot,
      serverOptions.outputPath,
    );
  }

  return {
    options: serverOptions,
    config,
    projectRoot,
    projectSourceRoot,
    i18n,
    target,

@angular-devkit/build-angular

Angular Webpack Build Facade

MIT
Latest version published 3 days ago

Package Health Score

100 / 100
Full package analysis

Popular @angular-devkit/build-angular functions