@@ -25,7 +25,6 @@ import {
2525 urlJoin ,
2626} from '../utils' ;
2727import { BundleActionExecutor } from '../utils/action-executor' ;
28- import { WebpackConfigOptions } from '../utils/build-options' ;
2928import { ThresholdSeverity , checkBudgets } from '../utils/bundle-calculator' ;
3029import { findCachePath } from '../utils/cache-path' ;
3130import { colors } from '../utils/color' ;
@@ -53,14 +52,14 @@ import {
5352 getIndexOutputFile ,
5453} from '../utils/webpack-browser-config' ;
5554import {
55+ getAnalyticsConfig ,
5656 getBrowserConfig ,
5757 getCommonConfig ,
5858 getStatsConfig ,
5959 getStylesConfig ,
6060 getTypeScriptConfig ,
6161 getWorkerConfig ,
6262} from '../webpack/configs' ;
63- import { NgBuildAnalyticsPlugin } from '../webpack/plugins/analytics' ;
6463import { markAsyncChunksNonInitial } from '../webpack/utils/async-chunks' ;
6564import { normalizeExtraEntryPoints } from '../webpack/utils/helpers' ;
6665import {
@@ -90,43 +89,6 @@ export type BrowserBuilderOutput = json.JsonObject &
9089 outputPath : string ;
9190 } ;
9291
93- export function getAnalyticsConfig (
94- wco : WebpackConfigOptions ,
95- context : BuilderContext ,
96- ) : webpack . Configuration {
97- if ( context . analytics ) {
98- // If there's analytics, add our plugin. Otherwise no need to slow down the build.
99- let category = 'build' ;
100- if ( context . builder ) {
101- // We already vetted that this is a "safe" package, otherwise the analytics would be noop.
102- category =
103- context . builder . builderName . split ( ':' ) [ 1 ] || context . builder . builderName || 'build' ;
104- }
105-
106- // The category is the builder name if it's an angular builder.
107- return {
108- plugins : [
109- new NgBuildAnalyticsPlugin (
110- wco . projectRoot ,
111- context . analytics ,
112- category ,
113- ! ! wco . tsConfig . options . enableIvy ,
114- ) ,
115- ] ,
116- } ;
117- }
118-
119- return { } ;
120- }
121-
122- export function getCompilerConfig ( wco : WebpackConfigOptions ) : webpack . Configuration {
123- if ( wco . buildOptions . main || wco . buildOptions . polyfills ) {
124- return getTypeScriptConfig ( wco ) ;
125- }
126-
127- return { } ;
128- }
129-
13092async function initialize (
13193 options : BrowserBuilderSchema ,
13294 context : BuilderContext ,
@@ -153,7 +115,7 @@ async function initialize(
153115 getStylesConfig ( wco ) ,
154116 getStatsConfig ( wco ) ,
155117 getAnalyticsConfig ( wco , context ) ,
156- getCompilerConfig ( wco ) ,
118+ getTypeScriptConfig ( wco ) ,
157119 wco . buildOptions . webWorkerTsConfig ? getWorkerConfig ( wco ) : { } ,
158120 ] ,
159121 { differentialLoadingNeeded } ,
0 commit comments