Skip to content

Commit

Permalink
fix(nf): correctly check for public directory in init schematic
Browse files Browse the repository at this point in the history
  • Loading branch information
manfredsteyer committed Aug 27, 2024
1 parent 7487744 commit 097c809
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libs/native-federation/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@angular-architects/native-federation",
"version": "18.1.2",
"version": "18.1.3",
"main": "src/index.js",
"generators": "./collection.json",
"builders": "./builders.json",
Expand Down
2 changes: 1 addition & 1 deletion libs/native-federation/src/builders/build/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ export async function* runBuilder(
fedOptions.outputPath,
url
);

const exists = fs.existsSync(fileName);

if (url !== '/' && url !== '' && exists) {
Expand Down
4 changes: 3 additions & 1 deletion libs/native-federation/src/patch-angular-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@
// const workspaceRoot = process.cwd();
// patchAngularBuild(workspaceRoot);

console.log('Please remove the postbuild task calling patch-angular-build. This is not needed since Native Federation 18.1 anymore!');
console.log(
'Please remove the postbuild task calling patch-angular-build. This is not needed since Native Federation 18.1 anymore!'
);
4 changes: 3 additions & 1 deletion libs/native-federation/src/schematics/init/schematic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,9 @@ function normalizeOptions(

let manifestRelPath = 'public/federation.manifest.json';

if (!tree.exists(publicPath)) {
const hasPublicFolder = tree.getDir(projectRoot).subdirs.map(p => String(p)).includes('public');

if (!hasPublicFolder) {
manifestPath = path
.join(projectRoot, 'src/assets/federation.manifest.json')
.replace(/\\/g, '/');
Expand Down

0 comments on commit 097c809

Please sign in to comment.