Skip to content

Commit

Permalink
Specify exports via package.json exports field (#26)
Browse files Browse the repository at this point in the history
* Specify exports via package.json exports field

* Simplify by relying on automatic type .d.ts resolution
  • Loading branch information
jorins committed Dec 15, 2023
1 parent 40f8740 commit 82dbf32
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@
"name": "t4t",
"version": "0.1.0",
"description": "Tools for Typescript general purpose utility library",
"main": "dist/index.js",
"files": [
"dist"
],
"exports": {
".": "./dist/index.js",
"./types": "./dist/types.js",
"./filters": "./dist/filters.js"
},
"scripts": {
"prepare": "husky install",
"test": "ts-mocha",
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export * as types from './type'
export * as filter from './filter'
export * as types from './types'
export * as filter from './filters'
File renamed without changes.
2 changes: 1 addition & 1 deletion test/type.test.ts → test/types.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import '../src/type'
import '../src/types'

import { expect } from 'chai'

Expand Down

0 comments on commit 82dbf32

Please sign in to comment.