Skip to content

Commit

Permalink
Support for custom host and custom output directories.
Browse files Browse the repository at this point in the history
Configuration options can now be specified from the code.
  • Loading branch information
Eptagone committed Jun 11, 2023
1 parent 45bbfcd commit f37bb5c
Show file tree
Hide file tree
Showing 18 changed files with 538 additions and 1,184 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -382,10 +382,10 @@ FodyWeavers.xsd

# VS Code files for those working on multiple tools
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
# !.vscode/settings.json
# !.vscode/tasks.json
# !.vscode/launch.json
# !.vscode/extensions.json
*.code-workspace

# Local History for Visual Studio Code
Expand Down
29 changes: 16 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,19 +192,7 @@ By default, the manifest name is `manifest.json` and it's expected to be in the
}
```

You can change the configuration for the middleware by overriding the following properties. ⚙️

| Property | Description |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
| `Vite:PackageManager` | The name of the package manager to use. Default value is `npm`. |
| `Vite:Server:AutoRun` | Enable or disable the automatic start of the Vite Dev Server. Default value is `false`. |
| `Vite:Server:KillPort` | Use with `Vite:Server:AutoRun` to kill the port before starting the Vite Development Server. Default value is `false`. |
| `Vite:Server:TimeOut` | The timeout in seconds spent waiting for the vite dev server. Default is `5` |
| `Vite:Server:Port` | The port where the Vite Development Server will be running. Default value is `5173`. |
| `Vite:Server:UseHttps` | If true, the middleware will use HTTPS to connect to the Vite Development Server. Default value is `false`. |
| `Vite:Server:ScriptName` | The script name to run the Vite Development Server. Default value is `dev`. |

See the following example.
You can also change the configuration for the middleware as follows.

```JSON
// appsettings.Development.json
Expand All @@ -222,6 +210,21 @@ See the following example.
}
```

And there are more options that you can change. All the available options are listed below. ⚙️

| Property | Description |
| ------------------------ | ---------------------------------------------------------------------------------------------------------------------- |
| `Vite:Manifest` | The manifest file name. Default is `manifest.json`. |
| `Vite:Base` | The subfolder where your assets will be located, including the manifest file, relative to the content root path. |
| `Vite:PackageManager` | The name of the package manager to use. Default value is `npm`. |
| `Vite:Server:AutoRun` | Enable or disable the automatic start of the Vite Dev Server. Default value is `false`. |
| `Vite:Server:Port` | The port where the Vite Development Server will be running. Default value is `5173`. |
| `Vite:Server:Host` | The host where the Vite Dev Server will be running. Default value is `localhost`. |
| `Vite:Server:KillPort` | Use with `Vite:Server:AutoRun` to kill the port before starting the Vite Development Server. Default value is `false`. |
| `Vite:Server:TimeOut` | The timeout in seconds spent waiting for the vite dev server. Default is `5` |
| `Vite:Server:Https` | If true, the middleware will use HTTPS to connect to the Vite Development Server. Default value is `false`. |
| `Vite:Server:ScriptName` | The script name to run the Vite Development Server. Default value is `dev`. |

## Examples

Do you want to see how to use this library in a real project? Take a look at [these examples](https://github.com/Eptagone/Vite.AspNetCore/tree/main/examples)
Loading

0 comments on commit f37bb5c

Please sign in to comment.