laravel-themer icon indicating copy to clipboard operation
laravel-themer copied to clipboard

have bug in build

Open vahidalvandi opened this issue 2 years ago • 3 comments

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

vahidalvandi avatar Feb 16 '23 21:02 vahidalvandi

+1 Up please provide docs to apply this libs on laravel 9++ vite is not working on build mode dev mode is good

reidsneo avatar Mar 23 '23 02:03 reidsneo

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

reidsneo avatar Mar 24 '23 05:03 reidsneo

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

RyderAsKing avatar Feb 08 '24 17:02 RyderAsKing