Skip to content

Commit

Permalink
Remove publishConfig.directory from built package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
michaldudak committed Jan 22, 2025
1 parent 8512dff commit dfa08aa
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions packages/react/scripts/createPackageManifest.mts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@ type TransformedExports = Record<

export async function createPackageManifest() {
const packageData = await fse.readFile(path.resolve(PROJECT_ROOT, './package.json'), 'utf8');
const { imports, exports, scripts, devDependencies, workspaces, ...otherPackageData } =
JSON.parse(packageData);
const {
imports,
exports,
scripts,
devDependencies,
workspaces,
publishConfig,
...otherPackageData
} = JSON.parse(packageData);

const newPackageData = {
...otherPackageData,
Expand All @@ -32,6 +39,9 @@ export async function createPackageManifest() {
},
},
exports: retargetExports(exports),
publishConfig: {
access: publishConfig.access,
},
};

const targetPath = path.resolve(PROJECT_BUILD_DIR, './package.json');
Expand Down

0 comments on commit dfa08aa

Please sign in to comment.