From d01b81f4a9fccfbe31b24ca15916c70010a39f58 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Sun, 17 Aug 2025 16:58:03 +0800 Subject: [PATCH] feat(init): initType default value is set to `module` (#9486) --- .changeset/shaggy-peaches-shop.md | 6 ++++++ config/config/src/index.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/shaggy-peaches-shop.md diff --git a/.changeset/shaggy-peaches-shop.md b/.changeset/shaggy-peaches-shop.md new file mode 100644 index 0000000000..b989a83e53 --- /dev/null +++ b/.changeset/shaggy-peaches-shop.md @@ -0,0 +1,6 @@ +--- +"@pnpm/config": major +"pnpm": major +--- + +The default value of the `type` field in the `package.json` file of the project initialized by `pnpm init` command has been changed to `module`. diff --git a/config/config/src/index.ts b/config/config/src/index.ts index 6610e532ce..9e93e69be8 100644 --- a/config/config/src/index.ts +++ b/config/config/src/index.ts @@ -164,7 +164,7 @@ export async function getConfig (opts: { 'ignore-workspace-root-check': false, 'optimistic-repeat-install': false, 'init-package-manager': true, - 'init-type': 'commonjs', + 'init-type': 'module', 'inject-workspace-packages': false, 'link-workspace-packages': false, 'lockfile-include-tarball-url': false,