Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

have bug in build #42

Open
vahidalvandi opened this issue Feb 16, 2023 · 3 comments
Open

have bug in build #42

vahidalvandi opened this issue Feb 16, 2023 · 3 comments

Comments

@vahidalvandi
Copy link

vahidalvandi commented Feb 16, 2023

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

@reidsneo
Copy link

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

@reidsneo
Copy link

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

@RyderAsKing
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants