Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(@angular-devkit/build-angular): remove no longer needed realpathSync #26714

Merged
merged 1 commit into from Dec 19, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -16,7 +16,6 @@ import type {
PluginBuild,
} from 'esbuild';
import assert from 'node:assert';
import { realpathSync } from 'node:fs';
import * as path from 'node:path';
import { maxWorkers } from '../../../utils/environment-options';
import { JavaScriptTransformer } from '../javascript-transformer';
Expand Down Expand Up @@ -57,18 +56,6 @@ export function createCompilerPlugin(
let setupWarnings: PartialMessage[] | undefined = [];
const preserveSymlinks = build.initialOptions.preserveSymlinks;

let tsconfigPath = pluginOptions.tsconfig;
if (!preserveSymlinks) {
// Use the real path of the tsconfig if not preserving symlinks.
// This ensures the TS source file paths are based on the real path of the configuration.
// NOTE: promises.realpath should not be used here since it uses realpath.native which
// can cause case conversion and other undesirable behavior on Windows systems.
// ref: https://github.com/nodejs/node/issues/7726
try {
tsconfigPath = realpathSync(tsconfigPath);
} catch {}
}

// Initialize a worker pool for JavaScript transformations
const javascriptTransformer = new JavaScriptTransformer(pluginOptions, maxWorkers);

Expand Down Expand Up @@ -240,7 +227,7 @@ export function createCompilerPlugin(
let referencedFiles;
try {
const initializationResult = await compilation.initialize(
tsconfigPath,
pluginOptions.tsconfig,
hostOptions,
createCompilerOptionsTransformer(setupWarnings, pluginOptions, preserveSymlinks),
);
Expand Down