Last change
on this file since 571e0df was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | "use strict";
|
---|
2 | /**
|
---|
3 | * @license
|
---|
4 | * Copyright Google LLC All Rights Reserved.
|
---|
5 | *
|
---|
6 | * Use of this source code is governed by an MIT-style license that can be
|
---|
7 | * found in the LICENSE file at https://angular.io/license
|
---|
8 | */
|
---|
9 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
10 | exports.getAnalyticsConfig = void 0;
|
---|
11 | const analytics_1 = require("../plugins/analytics");
|
---|
12 | function getAnalyticsConfig(wco, context) {
|
---|
13 | if (!context.analytics) {
|
---|
14 | return {};
|
---|
15 | }
|
---|
16 | // If there's analytics, add our plugin. Otherwise no need to slow down the build.
|
---|
17 | let category = 'build';
|
---|
18 | if (context.builder) {
|
---|
19 | // We already vetted that this is a "safe" package, otherwise the analytics would be noop.
|
---|
20 | category = context.builder.builderName.split(':')[1] || context.builder.builderName || 'build';
|
---|
21 | }
|
---|
22 | // The category is the builder name if it's an angular builder.
|
---|
23 | return {
|
---|
24 | plugins: [
|
---|
25 | new analytics_1.NgBuildAnalyticsPlugin(wco.projectRoot, context.analytics, category, !!wco.tsConfig.options.enableIvy),
|
---|
26 | ],
|
---|
27 | };
|
---|
28 | }
|
---|
29 | exports.getAnalyticsConfig = getAnalyticsConfig;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.