Skip to content

Commit

Permalink
docs: Add import option
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy351 committed Nov 2, 2024
1 parent 3603ec8 commit fc59711
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
13 changes: 12 additions & 1 deletion website/docs/cli/generate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,17 @@ Config path. Default to `kosko.toml` in current folder.

Environment name.

### `--import`

<AvailabilityInfo availability={{ kosko: "4.2.0" }} />

Preload ES modules at startup. Modules set in config file are also imported. This option only works when ECMAScript modules (ESM) is enabled.

```shell
# Using TypeScript
kosko generate --import tsx
```

### `--loader`

<AvailabilityInfo availability={{ kosko: "3.0.0" }} />
Expand All @@ -58,7 +69,7 @@ kosko generate --loader ts-node/esm

### `--require, -r`

Require external modules. Modules set in the config file will also be required.
Require CommonJS modules. Modules set in the config file will also be required.

```shell
# Using TypeScript
Expand Down
13 changes: 12 additions & 1 deletion website/docs/configuration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,17 @@ Extension names of components. It's unnecessary to manually set this option. It
extensions = ["js", "json"]
```

### `import`

<AvailabilityInfo availability={{ kosko: "4.2.0" }} />

Preload ES modules at startup. This option only works when ECMAScript modules (ESM) is enabled.

```toml
# Using TypeScript
import = ["tsx"]
```

### `loaders`

<AvailabilityInfo availability={{ kosko: "3.0.0" }} />
Expand All @@ -69,7 +80,7 @@ loaders = ["ts-node/esm"]

### `require`

Require external modules.
Require CommonJS modules.

#### Examples {#global-require-examples}

Expand Down

0 comments on commit fc59711

Please sign in to comment.