Skip to content

Commit

Permalink
fix: add test package export field
Browse files Browse the repository at this point in the history
  • Loading branch information
mihar-22 committed Jan 9, 2023
1 parent e7b4797 commit 1f6ea85
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@ $: pnpm i @maverick-js/signals
$: yarn add @maverick-js/signals
```

## Testing

Effects are currently disabled server-side. In order to run effects during tests you'll need to
configure your bundler's `conditions` field. The following example is for
[Vitest](https://vitest.dev):

```ts
// vite.config.ts
{
resolve: {
conditions: process.env.VITEST ? ['test'] : undefined,
}
}
```

## API

- [`root`](#root)
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"version": "5.6.4",
"type": "module",
"types": "dist/types/index.d.ts",
"main": "dist/server/index.cjs",
"module": "dist/prod/index.js",
"sideEffects": false,
"files": [
Expand Down Expand Up @@ -57,6 +58,7 @@
"exports": {
".": {
"import": {
"test": "./dist/dev/index.js",
"node": "./dist/server/index.js",
"deno": "./dist/server/index.js",
"bun": "./dist/server/index.js",
Expand All @@ -67,6 +69,7 @@
},
"./map": {
"import": {
"test": "./dist/dev/map.js",
"node": "./dist/server/map.js",
"deno": "./dist/server/map.js",
"bun": "./dist/server/index.js",
Expand Down

0 comments on commit 1f6ea85

Please sign in to comment.