Skip to content

Commit 3bc37e3

Browse files
committed
refactor: remove keepNames esbuild option for server builds
This option is no longer needed due to the changes done in the forked version of Domino.
1 parent fdd1958 commit 3bc37e3

File tree

3 files changed

+0
-18
lines changed

3 files changed

+0
-18
lines changed

packages/angular_devkit/build_angular/src/tools/webpack/configs/common.ts

-1
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,6 @@ export async function getCommonConfig(wco: WebpackConfigOptions): Promise<Config
300300
sourcemap: scriptsSourceMap,
301301
supportedBrowsers: buildOptions.supportedBrowsers,
302302
keepIdentifierNames: !allowMangle || isPlatformServer,
303-
keepNames: isPlatformServer,
304303
removeLicenses: buildOptions.extractLicenses,
305304
advanced: buildOptions.buildOptimizer,
306305
}),

packages/angular_devkit/build_angular/src/tools/webpack/plugins/javascript-optimizer-plugin.ts

-8
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,6 @@ export interface JavaScriptOptimizerOptions {
6161
*/
6262
keepIdentifierNames: boolean;
6363

64-
/**
65-
* Enables the retention of original name of classes and functions.
66-
*
67-
* **Note**: this causes increase of bundle size as it causes dead-code elimination to not work fully.
68-
*/
69-
keepNames: boolean;
70-
7164
/**
7265
* Enables the removal of all license comments from the output code.
7366
*/
@@ -166,7 +159,6 @@ export class JavaScriptOptimizerPlugin {
166159
const optimizeOptions: OptimizeRequestOptions = {
167160
sourcemap: this.options.sourcemap,
168161
define,
169-
keepNames: this.options.keepNames,
170162
keepIdentifierNames: this.options.keepIdentifierNames,
171163
target: this.targets,
172164
removeLicenses: this.options.removeLicenses,

packages/angular_devkit/build_angular/src/tools/webpack/plugins/javascript-optimizer-worker.ts

-9
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@ export interface OptimizeRequestOptions {
3232
*/
3333
keepIdentifierNames: boolean;
3434

35-
/**
36-
* Controls whether to retain the original name of classes and functions.
37-
*/
38-
keepNames: boolean;
3935
/**
4036
* Controls whether license text is removed from the output code.
4137
* Within the CLI, this option is linked to the license extraction functionality.
@@ -167,11 +163,6 @@ async function optimizeWithEsbuild(
167163
sourcefile: name,
168164
sourcemap: options.sourcemap && 'external',
169165
define: options.define,
170-
// This option should always be disabled for browser builds as we don't rely on `.name`
171-
// and causes deadcode to be retained which makes `NG_BUILD_MANGLE` unusable to investigate tree-shaking issues.
172-
// We enable `keepNames` only for server builds as Domino relies on `.name`.
173-
// Once we no longer rely on Domino for SSR we should be able to remove this.
174-
keepNames: options.keepNames,
175166
target: options.target,
176167
});
177168
} catch (error) {

0 commit comments

Comments
 (0)