Skip to content

Commit b454690

Browse files
committed
refactor(@angular-devkit/build-angular): update babel application preset with new plugin import location
The babel application preset that is used with the Webpack-based build system now also uses the updated location for the build optimizer plugins. This also reduces the amount of require statements in the setup function for the preset.
1 parent 7682a71 commit b454690

File tree

1 file changed

+11
-9
lines changed
  • packages/angular_devkit/build_angular/src/tools/babel/presets

1 file changed

+11
-9
lines changed

packages/angular_devkit/build_angular/src/tools/babel/presets/application.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -248,18 +248,20 @@ export default function (api: unknown, options: ApplicationPresetOptions) {
248248
}
249249

250250
if (options.optimize) {
251+
const {
252+
adjustStaticMembers,
253+
adjustTypeScriptEnums,
254+
elideAngularMetadata,
255+
markTopLevelPure,
256+
} = require('../plugins');
251257
if (options.optimize.pureTopLevel) {
252-
plugins.push(require('../plugins/pure-toplevel-functions').default);
258+
plugins.push(markTopLevelPure);
253259
}
254260

255-
plugins.push(
256-
require('../plugins/elide-angular-metadata').default,
257-
[require('../plugins/adjust-typescript-enums').default, { loose: true }],
258-
[
259-
require('../plugins/adjust-static-class-members').default,
260-
{ wrapDecorators: options.optimize.wrapDecorators },
261-
],
262-
);
261+
plugins.push(elideAngularMetadata, adjustTypeScriptEnums, [
262+
adjustStaticMembers,
263+
{ wrapDecorators: options.optimize.wrapDecorators },
264+
]);
263265
}
264266

265267
if (options.instrumentCode) {

0 commit comments

Comments
 (0)