Javascript

Customize Managed .js Files

To customize managed .js files in the Vendora project:

The .js files are located in the [vendora-project-directory-name/SRC-Assets/js/] folder, and a compressed version is created at [vendora-project-directory-name/HTML-Twig/dist/[theme-name]/assets/js/] folder after running the gulp command.

It's recommended to add your custom script to the custom.js file. This avoids conflicts in future updates, which might occur if you modify app-*.js or other js files.

Folder Structure
  • vendora-project-dir //(source files)
    • SRC-Assets //HTML-Twig project files
      • js //compressed javascript files here
        • app-product-date.js
        • app-product-list-map.js
        • app-product-map.js
        • app.js
        • custom.js
    • HTML-Twig //HTML-Twig project files
      • dist
        • [theme-name] //theme project files, eg : travel
          • assets
            • js //compressed javascript files here
              • app-product-date.js
              • app-product-list-map.js
              • app-product-map.js
              • app.js
              • custom.js
  • vendora-project-directory
    • assets
      • js
        • app.min.js // compresed version javascript.
    • src
      • js
        • app.js // javascript source files.
For customization
  • Minified .js File: You can customize the minified .js file in [vendora-project-directory-name/HTML-Twig/dist/[theme-name]/assets/js/] if you do not plan to use gulp automation again. Ensure you've completed steps from the Getting Started page up to running the gulp command.
    Avoid running gulp after customization, as it will overwrite changes.

  • Javascript Source Files: The recommended method is to customize the JavaScript source files in [vendora-project-directory-name/SRC-Assets/js].
    After customization, run gulp to automatically build a compressed version in [vendora-project-directory-name/HTML-Twig/dist/[theme-name]/assets/js/].