how to load javascript in custom module in backoffice.

Options
Shubham.Sharma22
Shubham.Sharma22 Staff Engineer Unconfirmed Posts: 2 🧑🏻‍🚀 - Cadet

I am trying to add assets directly Pyz/Zed/CustomModule/Presentation/Assets/js/custom-script.js but it's not fetching in backoffice.

Answers

  • sven.ommer
    sven.ommer Spryker Solution Partner Posts: 6 🧑🏻‍🚀 - Cadet

    You have to create a JS named "<modulename>.enty.js

    Inside of that you can "require" more js-data.

    The standard search and build-functionality for ZED looks for this pattern: **/Zed/**/*.entry.js

  • Shubham.Sharma22
    Shubham.Sharma22 Staff Engineer Unconfirmed Posts: 2 🧑🏻‍🚀 - Cadet

    I have already created and after creating i run following command but still when i am trying to load any page it's showing 404 error

    • frontend:zed:build
    • cache:empty-all