Muqthar Ali
Muqthar Ali

Reputation: 93

Migration of module federation to native federation in angular 17 project

I am using angular CLI 17 and module federation 17.

I am trying to migrate to angular new build system. In the existing angular.json, I have this builder

"builder": "ngx-build-plus:browser",

To use the new angular build system, I am migrating the module federation to native federation plug in using this migration guide

I have upgraded module federation to 18.0.4.

But when I run the below command

ng g @angular-architects/module-federation:remove --project  project-name

Getting this error

architect.build.options.main not found for project project-name

my angular.json has this hierarchy

"architect": {
        "build": {
          "builder": "ngx-build-plus:browser",
          "options": {
            "outputPath": "dist/project-name",
            "index": "src/index.html",
            "main": "src/main.ts"
          }

I don't understand what is the issue here.

Upvotes: 0

Views: 638

Answers (2)

Muqthar Ali
Muqthar Ali

Reputation: 93

I have used latest module-federation plug in which solved this issue @angular-architects/[email protected]

Please refer the issue here
https://github.com/angular-architects/module-federation-plugin/issues/646

Thanks to @manfredsteyer who fixed this issue and published the new version of module federation.

Upvotes: 0

Tony Brasunas
Tony Brasunas

Reputation: 4602

Ensure you have "browser": "src/main.ts" in angular.json > architect > esbuild > options

Remove the key main and use browser there.

To figure out the issue with browserTarget you'll have to show us the rest of your angular.json file

Upvotes: 0

Related Questions