@@ -26,31 +26,48 @@ function canUseIvyPlugin(wco: WebpackConfigOptions): boolean {
2626 return false ;
2727 }
2828
29- // Allow fallback to legacy build system via environment variable ('NG_BUILD_IVY_LEGACY=1')
30- const flag = process . env [ 'NG_BUILD_IVY_LEGACY' ] ;
31- if ( flag !== undefined && flag !== '0' && flag . toLowerCase ( ) !== 'false' ) {
32- wco . logger . warn (
33- '"NG_BUILD_IVY_LEGACY" environment variable detected. Using legacy Ivy build system.' ,
34- ) ;
35-
29+ // Allow new ivy build system via environment variable ('NG_BUILD_IVY_EXPERIMENTAL=1')
30+ // TODO: Remove this section and adjust warnings below once the Ivy plugin is the default
31+ const flag = process . env [ 'NG_BUILD_IVY_EXPERIMENTAL' ] ;
32+ if ( flag === undefined || flag === '0' || flag . toLowerCase ( ) === 'false' ) {
3633 return false ;
3734 }
3835
36+ // Allow fallback to legacy build system via environment variable ('NG_BUILD_IVY_LEGACY=1')
37+ // TODO: Enable this section once the Ivy plugin is the default
38+ // const flag = process.env['NG_BUILD_IVY_LEGACY'];
39+ // if (flag !== undefined && flag !== '0' && flag.toLowerCase() !== 'false') {
40+ // wco.logger.warn(
41+ // '"NG_BUILD_IVY_LEGACY" environment variable detected. Using legacy Ivy build system.',
42+ // );
43+
44+ // return false;
45+ // }
46+
3947 // Lazy modules option uses the deprecated string format for lazy routes which is not supported
4048 if ( wco . buildOptions . lazyModules && wco . buildOptions . lazyModules . length > 0 ) {
4149 wco . logger . warn (
42- '"lazyModules" option is deprecated and not supported by the new Ivy build system. ' +
43- 'Using legacy Ivy build system.'
50+ '"lazyModules" option is deprecated and not supported by the experimental Ivy build system. ' +
51+ 'Using existing Ivy build system.'
4452 ) ;
4553
4654 return false ;
4755 }
4856
4957 // This pass relies on internals of the original plugin
5058 if ( wco . buildOptions . experimentalRollupPass ) {
59+ wco . logger . warn (
60+ 'The experimental rollup pass is not supported by the experimental Ivy build system. ' +
61+ 'Using existing Ivy build system.'
62+ ) ;
63+
5164 return false ;
5265 }
5366
67+ wco . logger . warn (
68+ '"NG_BUILD_IVY_EXPERIMENTAL" environment variable detected. Using experimental Ivy build system.' ,
69+ ) ;
70+
5471 return true ;
5572}
5673
0 commit comments