I’ve created a simple application with 2 applications
- host-app
- createorders-app
wherein i’m trying to export a component from createorders-app and remote use it in host-app
but i’m getting an error
./projects/createorders-app/src/app/products/products.module.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js): Error: /Users/devidraj/Projects/angular/microfrontend/projects/createorders-app/src/app/products/products.module.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
structure is
-monolith-app
-host-app
-createorders-app
-products
without webpack.config the application builds successfully when i give the webpack config throws the above error.
const ModuleFederationPlugin = require('webpack').container.ModuleFederationPlugin;
module.exports = {
output: {
uniqueName: 'productListing',
publicPath: 'auto',
},
plugins: [
new ModuleFederationPlugin({
name: 'productListing',
filename: 'remoteEntry.js',
exposes: {
'./Module': './projects/createorders-app/src/app/products/products.module.ts',
},
shared: ['@angular/core', '@angular/common', '@angular/router'],
}),
],
};
The following are the version details
Angular CLI: 18.1.3
Node: 20.9.0
Package Manager: npm 10.1.0
OS: darwin arm64
Angular: ...
Package Version
------------------------------------------------------
@angular-devkit/architect 0.1801.3 (cli-only)
@angular-devkit/core 18.1.3 (cli-only)
@angular-devkit/schematics 18.1.3 (cli-only)
@schematics/angular 18.1.3 (cli-only)