Skip to content

Commit

Permalink
fix: pnpm @docusaurus/types hoist
Browse files Browse the repository at this point in the history
  • Loading branch information
2239559319 committed Jun 20, 2023
1 parent 48df4f1 commit f44b736
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/create-docusaurus/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,18 @@ export default async function init(
// Display the most elegant way to cd.
const cdpath = path.relative('.', dest);
const pkgManager = await getPackageManager(dest, cliOptions);

if (pkgManager === 'pnpm') {
await fs.writeFile(
path.join(dest, '.npmrc'),
`\npublic-hoist-pattern[]=@docusaurus/types`,
{
flag: 'a',
encoding: 'utf-8',
},
);
}

if (!cliOptions.skipInstall) {
shell.cd(dest);
logger.info`Installing dependencies with name=${pkgManager}...`;
Expand Down

0 comments on commit f44b736

Please sign in to comment.