@nx/module-federation
Version:
18 lines (17 loc) • 914 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getDynamicMfManifestFile = getDynamicMfManifestFile;
const path_1 = require("path");
const fs_1 = require("fs");
function getDynamicMfManifestFile(project, workspaceRoot) {
// {sourceRoot}/assets/module-federation.manifest.json was the generated
// path for the manifest file in the past. We now generate the manifest
// file at {root}/public/module-federation.manifest.json. This check
// ensures that we can still support the old path for backwards
// compatibility since old projects may still have the manifest file
// at the old path.
return [
(0, path_1.join)(workspaceRoot, project.root, 'public/module-federation.manifest.json'),
(0, path_1.join)(workspaceRoot, project.sourceRoot, 'assets/module-federation.manifest.json'),
].find((path) => (0, fs_1.existsSync)(path));
}