Skip to content

Commit

Permalink
fix(react): ensure module federation template files are indented corr…
Browse files Browse the repository at this point in the history
…ectly
  • Loading branch information
Coly010 committed Nov 1, 2024
1 parent 0f25b3c commit 8f6257d
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { loadRemote } from '@module-federation/enhanced/runtime';
<%_ if (remotes.length > 0) {
remotes.forEach(function(r) { _%>
<%_ if (dynamic) { _%>
const <%= r.className %> = React.lazy(() => loadRemote('<%= r.fileName %>/Module') as any)
const <%= r.className %> = React.lazy(() => loadRemote('<%= r.fileName %>/Module') as any)
<%_ } else { _%>
const <%= r.className %> = React.lazy(() => import('<%= r.fileName %>/Module'));
const <%= r.className %> = React.lazy(() => import('<%= r.fileName %>/Module'));
<%_ } _%>
<%_ }); _%>
<%_ } _%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<%_ if (dynamic) { _%>
import { init } from '@module-federation/enhanced/runtime';
import { init } from '@module-federation/enhanced/runtime';

fetch('/assets/module-federation.manifest.json')
.then((res) => res.json())
.then((remotes: Record<string, string>) =>
Object.entries(remotes).map(([name, entry]) => ({ name, entry }))
)
.then((remotes) => init({ name: '<%= projectName %>', remotes }))
.then(() => import('./bootstrap').catch(err => console.error(err)));
fetch('/assets/module-federation.manifest.json')
.then((res) => res.json())
.then((remotes: Record<string, string>) =>
Object.entries(remotes).map(([name, entry]) => ({ name, entry }))
)
.then((remotes) => init({ name: '<%= projectName %>', remotes }))
.then(() => import('./bootstrap').catch(err => console.error(err)));
<%_ } else { _%>
import('./bootstrap').catch(err => console.error(err));
import('./bootstrap').catch(err => console.error(err));
<%_ } _%>
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import { loadRemote } from '@module-federation/enhanced/runtime';
<%_ if (remotes.length > 0) {
remotes.forEach(function(r) { _%>
<%_ if (dynamic) { _%>
const <%= r.className %> = React.lazy(() => loadRemote('<%= r.fileName %>/Module') as any)
const <%= r.className %> = React.lazy(() => loadRemote('<%= r.fileName %>/Module') as any)
<%_ } else { _%>
const <%= r.className %> = React.lazy(() => import('<%= r.fileName %>/Module'));
const <%= r.className %> = React.lazy(() => import('<%= r.fileName %>/Module'));
<%_ } _%>
<%_ }); _%>
<%_ } _%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<%_ if (dynamic) { _%>
import { init } from '@module-federation/enhanced/runtime';
import { init } from '@module-federation/enhanced/runtime';

fetch('/assets/module-federation.manifest.json')
.then((res) => res.json())
.then((remotes: Record<string, string>) =>
Object.entries(remotes).map(([name, entry]) => ({ name, entry }))
)
.then((remotes) => init({ name: '<%= projectName %>', remotes }))
.then(() => import('./bootstrap').catch(err => console.error(err)));
fetch('/assets/module-federation.manifest.json')
.then((res) => res.json())
.then((remotes: Record<string, string>) =>
Object.entries(remotes).map(([name, entry]) => ({ name, entry }))
)
.then((remotes) => init({ name: '<%= projectName %>', remotes }))
.then(() => import('./bootstrap').catch(err => console.error(err)));
<%_ } else { _%>
import('./bootstrap').catch(err => console.error(err));
import('./bootstrap').catch(err => console.error(err));
<%_ } _%>
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import { loadRemote } from '@module-federation/enhanced/runtime';
<%_ if (remotes.length > 0) {
remotes.forEach(function(r) { _%>
<%_ if (dynamic) { _%>
const <%= r.className %> = React.lazy(() => loadRemote('<%= r.fileName %>/Module') as any)
const <%= r.className %> = React.lazy(() => loadRemote('<%= r.fileName %>/Module') as any)
<%_ } else { _%>
const <%= r.className %> = React.lazy(() => import('<%= r.fileName %>/Module'));
const <%= r.className %> = React.lazy(() => import('<%= r.fileName %>/Module'));
<%_ } _%>
<%_ }); _%>
<%_ } _%>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<%_ if (dynamic) { _%>
import { init } from '@module-federation/enhanced/runtime';
import { init } from '@module-federation/enhanced/runtime';

fetch('/assets/module-federation.manifest.json')
.then((res) => res.json())
.then((remotes: Record<string, string>) =>
Object.entries(remotes).map(([name, entry]) => ({ name, entry }))
)
.then((remotes) => init({ name: '<%= projectName %>', remotes }))
.then(() => import('./bootstrap').catch(err => console.error(err)));
fetch('/assets/module-federation.manifest.json')
.then((res) => res.json())
.then((remotes: Record<string, string>) =>
Object.entries(remotes).map(([name, entry]) => ({ name, entry }))
)
.then((remotes) => init({ name: '<%= projectName %>', remotes }))
.then(() => import('./bootstrap').catch(err => console.error(err)));
<%_ } else { _%>
import('./bootstrap').catch(err => console.error(err));
import('./bootstrap').catch(err => console.error(err));
<%_ } _%>

0 comments on commit 8f6257d

Please sign in to comment.