Commit c2e7f49
authored
feat: restore configurable hotfile option (#3)
## Summary
This PR restores the hotfile feature that was removed in commit 588863c,
addressing issue #2. The hotfile is now configurable and can be disabled
by setting `hotFile` to `false`.
## Why is this needed?
The hotfile allows Spring applications to detect when the Vite dev
server is running. Spring can check for the existence of this file to
determine whether to:
- Load assets from the Vite dev server (development mode)
- Load assets from the build directory (production mode)
## Changes
- ✅ Add `hotFile` configuration option to `VitePluginJavaConfig`
(`string | false`)
- ✅ Write hotfile on server start containing the dev server URL
- ✅ Clean up hotfile automatically on process exit
- ✅ Update `.gitignore` to ignore the `hot` file
- ✅ Update README with hotfile documentation and examples
## Configuration
The hotfile is enabled by default at `public/hot`, but can be customized
or disabled:
\`\`\`typescript
java({
input: 'src/main.ts',
hotFile: 'static/hot', // Custom path
// or
hotFile: false, // Disable hotfile generation
})
\`\`\`
## Test Plan
- [x] Lint passes
- [x] Type checks pass
- [x] All tests pass
- [x] Feature tested manually
Closes #2
🤖 Generated with [Claude Code](https://claude.com/claude-code)File tree
4 files changed
+28
-0
lines changed- packages/vite-plugin-java
- src
4 files changed
+28
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
| |||
55 | 56 | | |
56 | 57 | | |
57 | 58 | | |
| 59 | + | |
58 | 60 | | |
59 | 61 | | |
60 | 62 | | |
| |||
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| 77 | + | |
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
| |||
96 | 99 | | |
97 | 100 | | |
98 | 101 | | |
| 102 | + | |
99 | 103 | | |
100 | 104 | | |
101 | 105 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
35 | 44 | | |
36 | 45 | | |
37 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
129 | 133 | | |
130 | 134 | | |
131 | 135 | | |
| |||
138 | 142 | | |
139 | 143 | | |
140 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
141 | 152 | | |
142 | 153 | | |
143 | 154 | | |
| |||
203 | 214 | | |
204 | 215 | | |
205 | 216 | | |
| 217 | + | |
206 | 218 | | |
207 | 219 | | |
208 | 220 | | |
| |||
0 commit comments