Skip to content

Commit

Permalink
fix: dual entry
Browse files Browse the repository at this point in the history
  • Loading branch information
himself65 authored and huozhi committed Nov 23, 2024
1 parent 1c08595 commit d6f7dcd
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/integration/dual-entry/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import fs from 'fs'
import { assertFilesContent, createIntegrationTest } from '../utils'

describe('integration tsconfig-override', () => {
it('should not generate js types paths if not specified', async () => {
await createIntegrationTest(
{
directory: __dirname,
},
async ({ dir }) => {
assertFilesContent(dir, {
'./dist/subpath/nested.js': 'subpath/nested',
'./dist/subpath/nested.cjs': 'subpath/nested',
})
const subpathTypes = await import(`${dir}/dist/index.js`)
expect(fs.existsSync(subpathTypes)).toBe(false)
},
)
})
})
10 changes: 10 additions & 0 deletions test/integration/dual-entry/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"name": "undefined-types-paths",
"type": "module",
"exports": {
"./a": {
"workerd": "./dist/a.workerd.js",
"import": "./dist/a.js"
}
}
}
1 change: 1 addition & 0 deletions test/integration/dual-entry/src/a.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { internal } from './a/shared'
1 change: 1 addition & 0 deletions test/integration/dual-entry/src/a.workerd.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { internal } from './a/shared'
1 change: 1 addition & 0 deletions test/integration/dual-entry/src/a/shared.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const internal = 'a'

0 comments on commit d6f7dcd

Please sign in to comment.