• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Register
  • Login
Bagisto Forum

Bagisto

  • Register
  • Login
  • Search
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups

assets in a custom packages are not loading

Bug Report
2
3
329
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H
    hamayel last edited by 12 Feb 2025, 11:30

    i have created a new package and followed the instructions in the documentation https://devdocs.bagisto.com/2.2/packages/bundling-assets.html#directory-structure
    I added the references to the new package and when I run "npm run build" the package assets build under the public folder like configured in the vite.config but when I use bagisto_asset('images/whats-app.png') it crashed and return
    (Unable to locate file in Vite manifest: src/Resources/assets/images/whats-app.png)
    while the file exists in the mentioned path in the created package and in the public folder

    1 Reply Last reply Reply Quote 0
    • Rishabh-Webkul
      Rishabh-Webkul last edited by 13 Feb 2025, 15:01

      Hello @hamayel

      Kindly follow each and every steps which are mentioned in the doc.

      Also complete the vite step in your package and

      Add the following code to the config/bagisto-vite.php file:

      'blog' => [
      'hot_file' => 'blog-vite.hot',
      'build_directory' => 'themes/blog/build',
      'package_assets_directory' => 'src/Resources/assets',
      ],

      Update this code according to your package named and file structure.

      Thanks & Regards

      H 1 Reply Last reply 16 Feb 2025, 07:33 Reply Quote 0
      • H
        hamayel @Rishabh-Webkul last edited by 16 Feb 2025, 07:33

        @Rishabh-Webkul

        thanks for replay

        the issue solved by adding the package name in:
        bagisto_asset('images/whats-app.png','package_name')

        1 Reply Last reply Reply Quote 0
        1 out of 3
        • First post
          1/3
          Last post