Skip to content

Commit dde1333

Browse files
committed
docs: don't assume devDependency
1 parent 6e59861 commit dde1333

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

README.md

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,27 +15,25 @@ It's generally a good idea to check that you're all set up early in the developm
1515
## Installation
1616

1717
```shell
18-
npm install -D vite-plugin-valibot-env valibot
18+
npm install -vite-plugin-valibot-env valibot
1919
```
2020

2121
## Usage
2222

2323
Let's start with a very basic example
2424

2525
```javascript
26-
import { defineConfig } from 'vite';
27-
import * as v from 'valibot';
28-
import valibot from 'vite-plugin-valibot-env';
26+
import { defineConfig } from "vite";
27+
import * as v from "valibot";
28+
import valibot from "vite-plugin-valibot-env";
2929

3030
const schema = v.object({
3131
VITE_API_ENDPOINT: v.pipe(v.string(), v.url()),
32-
VITE_LOCALE: v.literal('en_US'),
32+
VITE_LOCALE: v.literal("en_US"),
3333
});
3434

3535
export default defineConfig({
36-
plugins: [
37-
valibot(schema),
38-
]
36+
plugins: [valibot(schema)],
3937
});
4038
```
4139

@@ -51,24 +49,24 @@ export default defineConfig({
5149
#### `options.ignoreEnvPrefix`
5250

5351
Type: `boolean`
54-
Default: `false`
52+
Default: `false`
5553

5654
Setting this to `true` will also validate unprefixed environment variables.
5755

5856
> [!TIP]
59-
> Vite uses a [prefix](https://vitejs.dev/config/shared-options.html#envprefix) to prevent leaking all environment variables into your code. The same limitation applies to the validator. However, there might be use cases where you want validate unprefixed environment variables as well, e.g. `HOST` and `PORT` to configure the Vite server.
57+
> Vite uses a [prefix](https://vitejs.dev/config/shared-options.html#envprefix) to prevent leaking all environment variables into your code. The same limitation applies to the validator. However, there might be use cases where you want validate unprefixed environment variables as well, e.g. `HOST` and `PORT` to configure the Vite server.
6058
6159
#### `options.transformValues`
6260

6361
Type: `boolean`
64-
Default: `false`
62+
Default: `false`
6563

6664
Setting this to `true` will try and transform string values to their respective types. Supports booleans, integers, floats, and `null`.
6765

6866
#### `options.language`
6967

7068
Type: `string`
71-
Default: `undefined`
69+
Default: `undefined`
7270

7371
Language ID for localized error messages.
7472

@@ -78,14 +76,14 @@ Language ID for localized error messages.
7876
#### `options.onBeforeIssues`
7977

8078
Type: `function`
81-
Default: `undefined`
79+
Default: `undefined`
8280

8381
A callback function executed after any issues have been printed.
8482

8583
#### `options.onAfterIssues`
8684

8785
Type: `function`
88-
Default: `undefined`
86+
Default: `undefined`
8987

9088
A callback function executed after all issues have been printed.
9189

@@ -95,7 +93,7 @@ A callback function executed after all issues have been printed.
9593
#### `options.throwError`
9694

9795
Type: `boolean`
98-
Default: `false`
96+
Default: `false`
9997

10098
> [!CAUTION]
10199
> This option exists for testing purposes and is not recommended for other use.

0 commit comments

Comments
 (0)