Skip to content

Commit edb8d27

Browse files
PNPM: Generate a pnpm-workspace.yaml for the LSP to work
1 parent c041c22 commit edb8d27

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/RescriptVersions.res

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ let installVersions = async ({rescriptVersion, rescriptCoreVersion}) => {
8686
switch packageManager {
8787
| YarnBerry => await ensureYarnNodeModulesLinker()
8888
| Pnpm =>
89+
let pnpmWorkspacePath = Path.join2(Process.cwd(), "pnpm-workspace.yaml")
90+
if !Fs.existsSync(pnpmWorkspacePath) {
91+
await Fs.Promises.writeFile(pnpmWorkspacePath, `shamefullyHoist: true${Os.eol}`)
92+
}
93+
8994
let hasPackageLock = Path.join2(Process.cwd(), "package-lock.json")->Fs.existsSync
9095
if hasPackageLock {
9196
await execCommand("import") // import versions from package-lock.json

0 commit comments

Comments
 (0)