Skip to content

native-federation builder i18n bug #404

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
refactorTractor opened this issue Dec 12, 2023 · 3 comments
Closed

native-federation builder i18n bug #404

refactorTractor opened this issue Dec 12, 2023 · 3 comments

Comments

@refactorTractor
Copy link

Hi!

I made a fork of one of your examples here and tried adding i18n. Aside from solving a minor problem, that buildTarget in extract-i18n had to be modified to directly refer to the esbuild config, I think I found a bug if i18n is supported from your side.

My build fails with the following call stack:

[error] Error: ENOENT: no such file or directory, open 'D:\work\temp\module-federation-plugin-example\dist\shell\index.html'
    at Object.openSync (node:fs:600:3)
    at Object.readFileSync (node:fs:468:35)
    at updateIndexHtml (D:\work\temp\module-federation-plugin-example\node_modules\@angular-architects\native-federation\src\utils\updateIndexHtml.js:16:27)
    at runBuilder_1 (D:\work\temp\module-federation-plugin-example\node_modules\@angular-architects\native-federation\src\builders\build\builder.js:108:59)

It's no suprise. With i18n turned on, the dist folder no longer contains an index.html, that is now in the language bundles' folders.

Has support for i18n been thought through also in the regards that shell and mfe builds of corresponding languages will have to 'meet'? Is that just a matter of where they are hosted relative to each other / what their baseHref is?

@refactorTractor
Copy link
Author

Though I have zero experience when it comes to writing custom builders, it seems like the problem is that your builder assumes outputPath is where everything is supposed to go. Instead it should take the options.localize and infer from it the subfolders for each bundle, and edit the index file in each (and I don't know if there are any other uncovered files). I however don't know how to do that, else I would have contributed.

@manfredsteyer
Copy link
Contributor

Unfortunately, Angular I18N is not supported.

@refactorTractor
Copy link
Author

refactorTractor commented Dec 15, 2023

Will it not be in the future though?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants