fix(bundling): add skipTypeField back for rollup executor (#17629)

This commit is contained in:
Evan Gillogley 2023-06-22 19:30:35 +01:00 committed by GitHub
parent 1e8de7a00e
commit 162b144467
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 2 deletions

View File

@ -169,6 +169,11 @@
"type": "boolean",
"description": "Whether to skip TypeScript type checking.",
"default": false
},
"skipTypeField": {
"type": "boolean",
"description": "Prevents 'type' field from being added to compiled package.json file. Use this if you are having an issue with this field.",
"default": false
}
},
"required": ["tsConfig", "main", "outputPath"],

View File

@ -45,8 +45,9 @@ export function updatePackageJson(
packageJson.main = './index.cjs';
exports['.']['require'] = './index.cjs';
}
if (!options.skipTypeField) {
packageJson.type = options.format.includes('esm') ? 'module' : 'commonjs';
}
// Support for older TS versions < 4.5
packageJson.types = types;

View File

@ -33,4 +33,5 @@ export interface RollupExecutorOptions {
generateExportsField?: boolean;
skipTypeCheck?: boolean;
babelUpwardRootMode?: boolean;
skipTypeField?: boolean;
}

View File

@ -156,6 +156,11 @@
"type": "boolean",
"description": "Whether to skip TypeScript type checking.",
"default": false
},
"skipTypeField": {
"type": "boolean",
"description": "Prevents 'type' field from being added to compiled package.json file. Use this if you are having an issue with this field.",
"default": false
}
},
"required": ["tsConfig", "main", "outputPath"],