Skip to content

New Vite plugin option and behavior#1079

Closed
jeremy-step wants to merge 191 commits into
nette:masterfrom
jeremy-step:master
Closed

New Vite plugin option and behavior#1079
jeremy-step wants to merge 191 commits into
nette:masterfrom
jeremy-step:master

Conversation

@jeremy-step

@jeremy-step jeremy-step commented Jun 24, 2025

Copy link
Copy Markdown
Contributor

Update Nette Docs to highlight new Vite Plugin options and behavior.

@dg dg force-pushed the master branch 27 times, most recently from 37002aa to 56a7648 Compare October 22, 2025 20:25
@dg

dg commented Jul 5, 2026

Copy link
Copy Markdown
Member

Thanks for the effort here. Unfortunately I can't merge this as written, because it documents a plugin API that doesn't exist in the released @nette/vite-plugin.

I verified against the plugin source (src/index.ts): the plugin's config interface is only

interface PluginConfig {
	infoFile?: string;
	entry?: string | string[];
}

There is no host option — the examples nette({ host: 'myapp.local' }) wouldn't do anything. The plugin derives the dev-server URL and the CORS origin from Vite's own server.host, and it does not set allowedHosts at all (it only sets server.cors.origin). This PR was based on nette/vite-plugin#2, which wasn't merged.

The current docs already cover cross-origin/domain setups correctly via server.host (see the "Working on Different Domains" section, Options 1 and 2). A dedicated Docker section (exposing the port, server.host: '0.0.0.0', strictPort, watch.usePolling) could be a nice future addition, but it needs to be written against the actual plugin behavior rather than the non-existent host option.

Closing for now — thanks again, and a PR against the plugin to actually add a host option would be very welcome.

@jeremy-step

Copy link
Copy Markdown
Contributor Author

Hi, I am confused, these docs were written for the mentioned plugin PR as you pointed out, which does add the host option.

Considering that PR is quite old and would need to be updated, would you actually be interested in merging it assuming I update it?

@dg

dg commented Jul 5, 2026

Copy link
Copy Markdown
Member

Sorry — I misread this. I didn't account for the fact that these docs are paired with the plugin PR that actually adds the host option; I compared them against the released plugin instead. My mistake.

I'm going to merge the plugin PR, so we'll take these docs too. I'll adapt the wording to the current structure of the assets/Vite page and verify each example against the plugin behavior. Thanks for your patience, and for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.