fox: avoid removing the types from vue, vue2 when install (#22814)

This commit is contained in:
Barthélémy Ledoux
2022-07-15 14:28:25 -05:00
committed by GitHub
parent 2383cafa93
commit 97ec82009c
4 changed files with 9 additions and 2 deletions

View File

@@ -49,6 +49,7 @@ packlist({ path: currentPackageDir })
// After everything is copied, let's update the Cypress cli package.json['exports'] map.
const isModule = currentPackageConfig.type === 'module'
const types = currentPackageConfig.types
const cliPackageConfig = require(path.join(cliPath, 'package.json'))
@@ -65,6 +66,11 @@ packlist({ path: currentPackageDir })
subPackageExports.require = `./${exportName}/${currentPackageConfig.main}`
}
if (types) {
// ./react/dist/cypress-react-cjs.js, etc
subPackageExports.types = `./${exportName}/${types}`
}
if (!cliPackageConfig.files.includes(exportName)) {
cliPackageConfig.files.push(exportName)
}