Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 59 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,15 @@ The target module is called with two arguments: `(options, loaderContext)`
To begin, you'll need to install `val-loader`:

```console
$ npm install val-loader --save-dev
npm install val-loader --save-dev
```

```console
yarn add -D val-loader
```

```console
pnpm add -D val-loader
```

Then add the loader to your `webpack` config. For example:
Expand Down Expand Up @@ -73,13 +81,16 @@ And run `webpack` via your preferred method.

## Options

| Name | Type | Default | Description |
| :-------------------------------------: | :--------: | :---------: | :-------------------------------------------- |
| **[`executableFile`](#executableFile)** | `{String}` | `undefined` | Allows to specify path to the executable file |
- **[`executableFile`](#executableFile)**

### executableFile
### `executableFile`

Type:

```ts
type executableFile = string;
```

Type: `String`
Default: `undefined`

Allows to specify path to the executable file
Expand Down Expand Up @@ -144,22 +155,37 @@ contain any number of additional properties.

### `code`

Type: `String|Buffer`
Type:

```ts
type code = string | Buffer;
```

Default: `undefined`
_Required_

Code passed along to webpack or the next loader that will replace the module.

### `sourceMap`

Type: `Object`
Type:

```ts
type sourceMap = object;
```

Default: `undefined`

A source map passed along to webpack or the next loader.

### `ast`

Type: `Array[Object]`
Type:

```ts
type ast = Array<object>;
```

Default: `undefined`

An [Abstract Syntax Tree](https://en.wikipedia.org/wiki/Abstract_syntax_tree)
Expand All @@ -168,7 +194,12 @@ next loader uses the same AST.

### `dependencies`

Type: `Array[String]`
Type:

```ts
type dependencies = Array<string>;
```

Default: `[]`

An array of absolute, native paths to file dependencies that should be watched by webpack for changes.
Expand All @@ -177,7 +208,12 @@ Dependencies can also be added using [`loaderContext.addDependency(file: string)

### `contextDependencies`

Type: `Array[String]`
Type:

```ts
type contextDependencies = Array<string>;
```

Default: `[]`

An array of absolute, native paths to directory dependencies that should be watched by webpack for changes.
Expand All @@ -186,7 +222,12 @@ Context dependencies can also be added using [`loaderContext.addContextDependenc

### `buildDependencies`

Type: `Array[String]`
Type:

```ts
type buildDependencies = Array<string>;
```

Default: `[]`

An array of absolute, native paths to directory dependencies that should be watched by webpack for changes.
Expand All @@ -195,7 +236,12 @@ Build dependencies can also be added using `loaderContext.addBuildDependency(fil

### `cacheable`

Type: `Boolean`
Type:

```ts
type cacheable = boolean;
```

Default: `false`

If `true`, specifies that the code can be re-used in watch mode if none of the
Expand Down