diff --git a/cli/package.json b/cli/package.json index e0d0a3303fb5..f9c2d09f146b 100644 --- a/cli/package.json +++ b/cli/package.json @@ -160,7 +160,7 @@ "./svelte": { "types": "./svelte/dist/index.d.ts", "import": "./svelte/dist/cypress-svelte.esm-bundler.js", - "require": "./svelte/dist/cypress-selte.cjs.js" + "require": "./svelte/dist/cypress-svelte.cjs.js" } }, "workspaces": { diff --git a/scripts/sync-exported-npm-with-cli.js b/scripts/sync-exported-npm-with-cli.js index 42518dafab2d..8682c2981202 100644 --- a/scripts/sync-exported-npm-with-cli.js +++ b/scripts/sync-exported-npm-with-cli.js @@ -54,6 +54,11 @@ packlist({ path: currentPackageDir }) const subPackageExports = cliPackageConfig.exports[`./${exportName}`] = {} const esmEntry = isModule ? currentPackageConfig.main : currentPackageConfig.module + if (types) { + // ./react/dist/cypress-react-cjs.js, etc + subPackageExports.types = `./${exportName}/${types}` + } + if (esmEntry) { // ./react/dist/cypress-react-esm.js, etc subPackageExports.import = `./${exportName}/${esmEntry}` @@ -64,11 +69,6 @@ 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) }