You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I added a library with the --buildable flag and then shared it with two apps using sharedMappings in the webpack.config.js files. Then I added a service which is being used in the aforementioned apps.
App dashboard sets a variable in the created service, then after clicking on the Login button, the login app logs the variable's value.
Serving the application works fine. Unfortunately, building the application fails (see Failure Logs) using the following command: nx run-many --target=build --all
Expected Behavior
That it builds fine.
Strangely enough, doing this without the --buildable flag, it works fine.
./libs/awesomelib/libname/src/index.ts - Error: Module build failed (from ./node_modules/@ngtools/webpack/src/ivy/index.js):
Error: C:\Workspace\nx\ng-mfe-example\libs\awesomelib\libname\src\index.ts is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
at C:\Workspace\nx\ng-mfe-example\node_modules\@ngtools\webpack\src\ivy\loader.js:59:26
The text was updated successfully, but these errors were encountered:
I'm a team member of @TomONeill and narrowed it down to this: we're registering the buildable library using the @angular-architects/module-federation-plugin and it resolves the lib through the tsconfig.base.json by name to the path where the sources of the lib are.
This works for a serve target, but when using the build target Nx builds the lib (because it's buildable) and won't use the lib sources anymore. Instead, it passes the build output at /dist/libs/awesomelib/libname through the typescript compiler.
This conflicts with the resolved location of the libs sources because webpack won't be able to find the source file in the typescript buildable files array and the build fails.
How are you addressing this issue? We really like the buildable libraries because it speeds up building when no changes are in the lib (Nx build caching), but I can't seem to think of a possible solution for this issue.
Current Behavior
I added a library with the
--buildable
flag and then shared it with two apps usingsharedMappings
in thewebpack.config.js
files. Then I added a service which is being used in the aforementioned apps.App
dashboard
sets a variable in the created service, then after clicking on theLogin
button, thelogin
app logs the variable's value.Serving the application works fine. Unfortunately, building the application fails (see Failure Logs) using the following command:
nx run-many --target=build --all
Expected Behavior
That it builds fine.
Strangely enough, doing this without the
--buildable
flag, it works fine.Steps to Reproduce
I forked the following repo: https://github.com/Coly010/ng-mfe-example and did what has been described in the Current Behavior: https://github.com/TomONeill/ng-mfe-example/commit/f62aeb9702ee7fa97dd85948991253a8ba1c713c
Failure Logs
The text was updated successfully, but these errors were encountered: