Skip to content

Commit

Permalink
fix(nf): activate code splitting in esbuild adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
manfredsteyer committed Jan 21, 2024
1 parent 80aacae commit 180de7b
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions libs/native-federation/migrate-appbuilder.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ This requires some changes in the `angular.json`. If you go with a default confi
```
ng g @angular-architects/native-federation:appbuilder
```

You need to run this command for each application using Native Federation.

For more advanced cases, please find a diff of the changes needed for this version:
Expand Down
9 changes: 7 additions & 2 deletions libs/native-federation/src/builders/build/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,16 @@ export async function* runBuilder(
let builder = await context.getBuilderNameForTarget(target);

if (builder === '@angular-devkit/build-angular:browser-esbuild') {
logger.info('.: UPDATE NEEDED :.');
logger.info('.: NATIVE FEDERATION - UPDATE NEEDED :.');
logger.info('');
logger.info("Since version 17.1, Native Federation uses Angular's");
logger.info('Application-Builder and its Dev-Server.');
logger.info('Please update your project config, e.g. in angular.json');
logger.info('');
logger.info('If you are sill on Angular 17.0.x, please update to');
logger.info('Angular 17.1.x or downgrade to Native Federation 17.0.x.');
logger.info('');
logger.info('For working with Native Federation 17.1.x (recommented), ');
logger.info('please update your project config, e.g. in angular.json');
logger.info('');
logger.info('This command performs the needed update for default configs:');
logger.info('');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ async function runEsbuild(
'async-await': false,
'object-rest-spread': false,
},
splitting: true,
platform: 'browser',
format: 'esm',
target: ['esnext'],
Expand Down

0 comments on commit 180de7b

Please sign in to comment.