File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,6 +4,8 @@ import { env } from 'process';
44import webpack from 'webpack' ;
55import { readJsonFromVisual } from './utils.js' ;
66
7+ const ModuleFederationPlugin = webpack . container . ModuleFederationPlugin ;
8+
79const ngJson = readJsonFromVisual ( 'angular.json' ) ;
810const projectName = env . VISUAL_NAME ! ;
911const visualRoot = ngJson . projects [ projectName ] . root ;
@@ -25,7 +27,9 @@ getDirectories(sourceRoot).forEach(dir => {
2527 }
2628} ) ;
2729
28- const ModuleFederationPlugin = webpack . container . ModuleFederationPlugin ;
30+ const ngCorePkgJson = readJsonFromVisual ( 'node_modules/@angular/core/package.json' ) ;
31+ const ngVersion = ngCorePkgJson . version ;
32+ const ngMajorVersion = ngVersion . split ( '.' ) [ 0 ] ;
2933
3034export default {
3135 devServer : {
@@ -52,17 +56,17 @@ export default {
5256 '@angular/core' : {
5357 singleton : true ,
5458 eager : true ,
55- requiredVersion : '^18 .0.0' ,
59+ requiredVersion : `^ ${ ngMajorVersion } .0.0` ,
5660 } ,
5761 '@angular/common' : {
5862 singleton : true ,
5963 eager : true ,
60- requiredVersion : '^18 .0.0' ,
64+ requiredVersion : `^ ${ ngMajorVersion } .0.0` ,
6165 } ,
6266 '@angular/forms' : {
6367 singleton : true ,
6468 eager : true ,
65- requiredVersion : '^18 .0.0' ,
69+ requiredVersion : `^ ${ ngMajorVersion } .0.0` ,
6670 } ,
6771 'rxjs' : {
6872 singleton : true ,
You can’t perform that action at this time.
0 commit comments