Skip to content

Commit

Permalink
fix: ensure bundler module resolution works with runtime type impor…
Browse files Browse the repository at this point in the history
…ts (#2470)
  • Loading branch information
danielroe committed Dec 19, 2023
1 parent 6dcf464 commit dff252b
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 2 deletions.
11 changes: 11 additions & 0 deletions build.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { defineBuildConfig } from 'unbuild'

export default defineBuildConfig({
entries: [
{
input: 'src/runtime/',
outDir: 'dist/runtime',
ext: 'js'
}
]
})
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
"import": "./dist/module.mjs",
"require": "./dist/module.cjs"
},
"./transformers": "./dist/runtime/transformers/index.mjs",
"./transformers/*": "./dist/runtime/transformers/*.mjs"
"./transformers": "./dist/runtime/transformers/index.js",
"./transformers/*": "./dist/runtime/transformers/*.js",
"./types": "./dist/runtime/types/index.js",
"./dist/runtime/types": "./dist/runtime/types/index.js"
},
"main": "./dist/module.cjs",
"module": "./dist/module.mjs",
Expand Down
3 changes: 3 additions & 0 deletions src/runtime/types/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,6 @@ export interface ContentQueryWithSurround<T> {
export interface ContentQueryWithDirConfig {
dirConfig: Record<string, any>
}

// Ensure that a .js file is emitted too
export {}
3 changes: 3 additions & 0 deletions src/runtime/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,3 +514,6 @@ export interface NavItem {

[key: string]: any
}

// Ensure that a .js file is emitted too
export {}
3 changes: 3 additions & 0 deletions src/runtime/types/query.ts
Original file line number Diff line number Diff line change
Expand Up @@ -347,3 +347,6 @@ export interface ContentQueryBuilder<T = ParsedContentMeta, Y = {}> {
}

export type ContentQueryFetcher<T> = (query: ContentQueryBuilder<T>) => Promise<ContentQueryResponse>

// Ensure that a .js file is emitted too
export {}

0 comments on commit dff252b

Please sign in to comment.