Skip to content

Commit 97ec820

Browse files
author
Barthélémy Ledoux
authored
fox: avoid removing the types from vue, vue2 when install (#22814)
1 parent 2383caf commit 97ec820

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

npm/mount-utils/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"files": [
1818
"dist"
1919
],
20+
"types": "dist/index.d.ts",
2021
"license": "MIT",
2122
"repository": {
2223
"type": "git",

npm/vue/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
"engines": {
5151
"node": ">=8"
5252
},
53-
"types": "dist",
53+
"types": "dist/index.d.ts",
5454
"license": "MIT",
5555
"repository": {
5656
"type": "git",

npm/vue2/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"engines": {
3838
"node": ">=8"
3939
},
40-
"types": "dist",
40+
"types": "dist/index.d.ts",
4141
"license": "MIT",
4242
"repository": {
4343
"type": "git",

scripts/sync-exported-npm-with-cli.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ packlist({ path: currentPackageDir })
4949

5050
// After everything is copied, let's update the Cypress cli package.json['exports'] map.
5151
const isModule = currentPackageConfig.type === 'module'
52+
const types = currentPackageConfig.types
5253

5354
const cliPackageConfig = require(path.join(cliPath, 'package.json'))
5455

@@ -65,6 +66,11 @@ packlist({ path: currentPackageDir })
6566
subPackageExports.require = `./${exportName}/${currentPackageConfig.main}`
6667
}
6768

69+
if (types) {
70+
// ./react/dist/cypress-react-cjs.js, etc
71+
subPackageExports.types = `./${exportName}/${types}`
72+
}
73+
6874
if (!cliPackageConfig.files.includes(exportName)) {
6975
cliPackageConfig.files.push(exportName)
7076
}

0 commit comments

Comments
 (0)