laravel-themer
laravel-themer copied to clipboard
have bug in build
after build return error
Vite manifest not found at: /themer/public/build/manifest.json
becuase build folder not exist and just have /public/vahid and cant detect /public/vahid/manifest.json
build theme must add in /public/build/vahid
+1 Up please provide docs to apply this libs on laravel 9++ vite is not working on build mode dev mode is good
Bro I got solution, you must run build with the theme configuration
"dev:theme-name": "vite --config themes/theme-name/vite.config.js",
"build:theme-name": "vite build --config themes/theme-name/vite.config.js"
add this on your package.json file
then build ONLY with this npm run build:theme-name command you will get /public/theme-name/ folder instead of /public/build folder, if you didn't run the theme command build, it will use standard vite builder instead of vite qirolab theme builder
Friendly note : to add asset on blade file please use:
{{ Vite::asset('themes/theme-name/images/logo.png', 'theme-name') }}
seconds parameter in Vite::asset() is for the theme name!
incase you want to add multiple assets in specific section, use this instead :
@yield('css')
@vite(
[
'themes/theme-name/sass/bootstrap.scss',
'themes/theme-name/sass/icons.scss',
'themes/theme-name/sass/app.scss',
'themes/theme-name/sass/custom.scss',
], 'theme-name')
@yield('css')
again second @vite()
parameter is your theme name
Hello guys 👋
You should pass the name of the theme (folder) while using Vite.
eg. themes/ryd/layouts/app.blade.php is where I include these assets so instead of passing in the name of the assets like this
@vite(['themes/ryd/css/app.css', 'themes/ryd/js/app.js'])
you would have to pass them like this
@vite(['themes/ryd/css/app.css', 'themes/ryd/js/app.js'], 'ryd')
in this case the name of the theme is ryd. This way it will look for vite manifest under /public/ryd/manifest.json instead of /public/build