Skip to content

Commit e8916bb

Browse files
authored
Merge pull request #346 from csandman/exports-and-build
Improve the `exports` and modify the tsup build config
2 parents 7f4b743 + 765b644 commit e8916bb

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,9 @@ The API for an individual style function looks like this:
526526

527527
```js
528528
/**
529-
* @param {CSSObject} provided -- The component's default Chakra styles
529+
* @param {SystemStyleObject} provided -- The component's default Chakra styles
530530
* @param {Object} state -- The component's current state e.g. `isFocused` (this gives all of the same props that are passed into the component)
531-
* @returns {CSSObject} An output style object which is forwarded to the component's `sx` prop
531+
* @returns {SystemStyleObject} An output style object which is forwarded to the component's `sx` prop
532532
*/
533533
function option(provided, state) {
534534
return {
@@ -807,7 +807,7 @@ offered by this package:
807807
`chakraStyles` that can be passed to customize the component styles. This is
808808
almost identical to the built-in `StylesConfig` type, however, it uses
809809
Chakra's
810-
[`CSSObject`](https://github.com/chakra-ui/chakra-ui/blob/790d2417a3f5d59e2d69229a027af671c2dc0cbc/packages/styled-system/src/system.types.ts#L81)
810+
[`SystemStyleObject`](https://github.com/chakra-ui/chakra-ui/blob/v2/packages/styled-system/src/system.types.ts#L80)
811811
type instead of react-select's emotion styles. It also has the same three
812812
generics as your `Select` component which would be required if you define your
813813
styles separately from your component.
@@ -1042,7 +1042,7 @@ const App = () => (
10421042
components={asyncComponents}
10431043
loadOptions={(inputValue, callback) => {
10441044
setTimeout(() => {
1045-
const values = colourOptions.filter((i) =>
1045+
const values = colorOptions.filter((i) =>
10461046
i.label.toLowerCase().includes(inputValue.toLowerCase())
10471047
);
10481048
callback(values);

package.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,14 @@
1414
},
1515
"exports": {
1616
".": {
17-
"import": "./dist/index.mjs",
18-
"require": "./dist/index.js"
17+
"import": {
18+
"types": "./dist/index.d.mts",
19+
"default": "./dist/index.mjs"
20+
},
21+
"require": {
22+
"types": "./dist/index.d.ts",
23+
"default": "./dist/index.js"
24+
}
1925
},
2026
"./package.json": "./package.json"
2127
},

tsup.config.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ export default defineConfig({
55
entry: ["src/index.ts"],
66
format: ["cjs", "esm"],
77
target: "es2019",
8-
sourcemap: true,
98
dts: true,
10-
minify: true,
119
treeshake: true,
1210
});

0 commit comments

Comments
 (0)