mirror of
https://github.com/actualbudget/actual.git
synced 2026-10-11 22:49:59 +00:00
34 lines
618 B
JavaScript
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;
|
|
}
|
|
},
|
|
},
|
|
}),
|
|
};
|