From 96715aa9e98643336d9542ec5a89053e31cd3472 Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Thu, 26 Oct 2023 07:57:01 -0300 Subject: [PATCH] fixes --- .../webpack/webpack.microfrontend.js.jhi.ejs | 10 ++-------- .../webpack/webpack.microfrontend.js.jhi.vue.ejs | 13 +++++++++++++ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/generators/client/templates/webpack/webpack.microfrontend.js.jhi.ejs b/generators/client/templates/webpack/webpack.microfrontend.js.jhi.ejs index ad5c815a9eea..d2197a5badd8 100644 --- a/generators/client/templates/webpack/webpack.microfrontend.js.jhi.ejs +++ b/generators/client/templates/webpack/webpack.microfrontend.js.jhi.ejs @@ -20,6 +20,7 @@ // Register sections and max allowed fragments, 0 for unlimited. fragments.registerSections({ importsSection:0, + configSection: 0, moduleFederationSection: 0, pluginsSection: 0, }); @@ -48,14 +49,7 @@ module.exports = ({ serve }) => { chunkIds: 'named', runtimeChunk: false, }, -<%_ if (applicationTypeGateway && clientFrameworkVue) { _%> - resolve: { - fallback: { - // Workaround https://github.com/module-federation/universe/issues/1575 - path: false, - }, - }, -<%_ } _%> +<&- fragments.configSection() &> plugins: [ new ModuleFederationPlugin({ <%_ if (applicationTypeMicroservice) { _%> diff --git a/generators/vue/templates/webpack/webpack.microfrontend.js.jhi.vue.ejs b/generators/vue/templates/webpack/webpack.microfrontend.js.jhi.vue.ejs index 6324ce78e9e7..d3dfd1fa5ce6 100644 --- a/generators/vue/templates/webpack/webpack.microfrontend.js.jhi.vue.ejs +++ b/generators/vue/templates/webpack/webpack.microfrontend.js.jhi.vue.ejs @@ -21,6 +21,18 @@ const { DefinePlugin } = require('webpack'); <%_ } _%> <&_ } -&> + +<&_ if (fragment.configSection) { -&> +<%_ if (applicationTypeGateway && clientFrameworkVue) { _%> + resolve: { + fallback: { + // Workaround https://github.com/module-federation/universe/issues/1575 + path: false, + }, + }, +<%_ } _%> +<&_ } -&> + <&_ if (fragment.moduleFederationSection) { -&> <%_ if (applicationTypeMicroservice) { _%> exposes: { @@ -37,6 +49,7 @@ const { DefinePlugin } = require('webpack'); ), }, <&_ } -&> + <&_ if (fragment.pluginsSection) { -&> <%_ if (applicationTypeMicroservice) { _%> new DefinePlugin({