Files
actual/.yarn/plugins/strip-publish-config.cjs
T
Matt Fiddaman 74ae626094 fix yarn publish warning (#9073)
* fix yarn publish warning

* note
2026-10-02 15:58:48 +00:00

34 lines
618 B
JavaScript

const APPLIED_FIELDS = [
'type',
'main',
'browser',
'module',
'exports',
'imports',
'bin',
'types',
'typings',
];
module.exports = {
name: 'strip-publish-config',
factory: () => ({
hooks: {
beforeWorkspacePacking(workspace, rawManifest) {
const publishConfig = rawManifest.publishConfig;
if (!publishConfig) {
return;
}
for (const field of APPLIED_FIELDS) {
delete publishConfig[field];
}
if (Object.keys(publishConfig).length === 0) {
delete rawManifest.publishConfig;
}
},
},
}),
};