litestar-vite-plugin 0.9.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -3
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -18,6 +18,8 @@ from pathlib import Path
|
|
|
18
18
|
from litestar import Controller, get, Litestar
|
|
19
19
|
from litestar.response import Template
|
|
20
20
|
from litestar.status_codes import HTTP_200_OK
|
|
21
|
+
from litestar.template.config import TemplateConfig
|
|
22
|
+
from litestar.contrib.jinja import JinjaTemplateEngine
|
|
21
23
|
from litestar_vite import ViteConfig, VitePlugin
|
|
22
24
|
|
|
23
25
|
class WebController(Controller):
|
|
@@ -29,9 +31,9 @@ class WebController(Controller):
|
|
|
29
31
|
async def index(self) -> Template:
|
|
30
32
|
return Template(template_name="index.html.j2")
|
|
31
33
|
|
|
32
|
-
|
|
33
|
-
vite = VitePlugin(config=ViteConfig(
|
|
34
|
-
app = Litestar(plugins=[vite], route_handlers=[WebController])
|
|
34
|
+
template_config = TemplateConfig(engine=JinjaTemplateEngine(directory='templates/'))
|
|
35
|
+
vite = VitePlugin(config=ViteConfig())
|
|
36
|
+
app = Litestar(plugins=[vite], template_config=template_config, route_handlers=[WebController])
|
|
35
37
|
|
|
36
38
|
```
|
|
37
39
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "litestar-vite-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Litestar plugin for Vite.",
|
|
6
6
|
"keywords": ["litestar", "vite", "vite-plugin"],
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"happy-dom": "^15.11.7",
|
|
43
43
|
"typescript": "^5.7.2",
|
|
44
44
|
"vite": "^6.0.1",
|
|
45
|
-
"vitest": "^2.1.
|
|
45
|
+
"vitest": "^2.1.8"
|
|
46
46
|
},
|
|
47
47
|
"peerDependencies": {
|
|
48
48
|
"vite": "^5.0.0 || ^6.0.0"
|