Skip to content

Commit

Permalink
fix(bundling): add skipTypeField back for rollup executor (#17629)
Browse files Browse the repository at this point in the history
  • Loading branch information
evanjmg authored Jun 22, 2023
1 parent 1e8de7a commit 162b144
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions docs/generated/packages/rollup/executors/rollup.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,9 @@ export function updatePackageJson(
packageJson.main = './index.cjs';
exports['.']['require'] = './index.cjs';
}

packageJson.type = options.format.includes('esm') ? 'module' : 'commonjs';
if (!options.skipTypeField) {
packageJson.type = options.format.includes('esm') ? 'module' : 'commonjs';
}

// Support for older TS versions < 4.5
packageJson.types = types;
Expand Down
1 change: 1 addition & 0 deletions packages/rollup/src/executors/rollup/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,5 @@ export interface RollupExecutorOptions {
generateExportsField?: boolean;
skipTypeCheck?: boolean;
babelUpwardRootMode?: boolean;
skipTypeField?: boolean;
}
5 changes: 5 additions & 0 deletions packages/rollup/src/executors/rollup/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
Expand Down

1 comment on commit 162b144

@vercel
Copy link

@vercel vercel bot commented on 162b144 Jun 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

nx-dev – ./

nx-five.vercel.app
nx-dev-git-master-nrwl.vercel.app
nx.dev
nx-dev-nrwl.vercel.app

Please sign in to comment.