Skip to content

Commit 097c809

Browse files
committed
fix(nf): correctly check for public directory in init schematic
1 parent 7487744 commit 097c809

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

libs/native-federation/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular-architects/native-federation",
3-
"version": "18.1.2",
3+
"version": "18.1.3",
44
"main": "src/index.js",
55
"generators": "./collection.json",
66
"builders": "./builders.json",

libs/native-federation/src/builders/build/builder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ export async function* runBuilder(
191191
fedOptions.outputPath,
192192
url
193193
);
194-
194+
195195
const exists = fs.existsSync(fileName);
196196

197197
if (url !== '/' && url !== '' && exists) {

libs/native-federation/src/patch-angular-build.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,6 @@
33
// const workspaceRoot = process.cwd();
44
// patchAngularBuild(workspaceRoot);
55

6-
console.log('Please remove the postbuild task calling patch-angular-build. This is not needed since Native Federation 18.1 anymore!');
6+
console.log(
7+
'Please remove the postbuild task calling patch-angular-build. This is not needed since Native Federation 18.1 anymore!'
8+
);

libs/native-federation/src/schematics/init/schematic.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,9 @@ function normalizeOptions(
283283

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

286-
if (!tree.exists(publicPath)) {
286+
const hasPublicFolder = tree.getDir(projectRoot).subdirs.map(p => String(p)).includes('public');
287+
288+
if (!hasPublicFolder) {
287289
manifestPath = path
288290
.join(projectRoot, 'src/assets/federation.manifest.json')
289291
.replace(/\\/g, '/');

0 commit comments

Comments
 (0)