F
Filament10mo ago
johny7

Use filament custom theme without npm/node

Hello everyone, is it possible, to use a custom theme in filament without npm? My webspace provider don't provide node. So I can use purely php. But when creating and registering a new custom template, this template works only during running npm run dev. So, when it's possible, what I have to do? I don't find anything about this in the docs neither via google search. Thanks in advance
Solution:
In local run npm run build push build file to git. pull from server and it will work
Jump to solution
8 Replies
einnlleinhatt_
einnlleinhatt_10mo ago
Can you use ftp ? Or when you ready to publish your template you can just run npm prod and copy all the files to your web services using ftp
krekas
krekas10mo ago
You can compile on your machine and upload everything But better ditch such provider
Solution
Vp
Vp10mo ago
In local run npm run build push build file to git. pull from server and it will work
johny7
johny710mo ago
Thank you very much for these approaches, in any case, you are already helping me. I guess this will help me in any case. Otherwise, I would look up here again for more in-depth questions. This is just the only one that offers me the required scope of services for free.
krekas
krekas10mo ago
keep searching I guess
johny7
johny710mo ago
For my understanding: Into which directories is compiling done with npm run dev or npm run build?
krekas
krekas10mo ago
same
johny7
johny710mo ago
Hm. When I run npm run buildI became a broken template. Running npm run devthe vite server is runs and I get a working template. Shuting down the vite server, the template brokes. Using ->viteTheme('resources/css/filament/app/theme.css')in the PanelServiceProvider my template references assets at the vite server:
<script type="module" src="http://[::1]:5173/@vite/client"></script>
<link rel="stylesheet" href="http://[::1]:5173/resources/css/filament/app/theme.css" />
<script type="module" src="http://[::1]:5173/@vite/client"></script>
<link rel="stylesheet" href="http://[::1]:5173/resources/css/filament/app/theme.css" />
So how can I use my template without an active vite-server? The generated assets at public\build... aren't used anywhere. What I'm doing wrong? I found the error: file public\hot coontains http://[::1]:5173/, after deleting it, the right references appears.
Want results from more Discord servers?
Add your server
More Posts