How to use the @angular-devkit/build-angular/src/utils/delete-output-dir.deleteOutputDir 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
],
  );

  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,
  };
}
github enten / udk / angular / lib / ng-devkit.ts View on Github external
export function deleteConfigOutputPath(
  root: string,
  host: virtualFs.Host,
  config: webpack.Configuration,
) {
  if (!config.output || !config.output.path) {
    return Promise.resolve();
  }

  return deleteOutputDir(
    normalize(root),
    normalize(config.output.path),
    host,
  ).toPromise();
}
github enten / udk / angular / lib / build / ng-devkit.ts View on Github external
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,
      browserOptions.outputPath,
    );
  }

  return {
    options: browserOptions,
    config,
    projectRoot,
    projectSourceRoot,
    i18n,
    isDifferentialLoadingNeeded,
    target,
    useBundleDownleveling,
  };
}

@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