Jump to content

Where should I add my custom JS files


Recommended Posts

I am owner of the website (it's not a plugin/application).

In the past, I added my JS under theme folder and added it in includJs using {resource}

But I noticed, it caused 10+ additional requests when someone visits the website.

How do I package under my JS with invision resource to avoid extra network requests?

Link to comment
Share on other sites

Every file you include on the page will initiate a network request. We do not recommend packaging custom Javascript into our own core Javascript. You're best off, if you have multiple Javascript files to include that are your own and being loaded from your server, just put them in as few files as you can and include them into the "Page Output" tab in ACP -> System -> Advanced Configuration, as needed.

Link to comment
Share on other sites

3 minutes ago, Jim M said:

Every file you include on the page will initiate a network request. We do not recommend packaging custom Javascript into our own core Javascript. You're best off, if you have multiple Javascript files to include that are your own and being loaded from your server, just put them in as few files as you can and include them into the "Page Output" tab in ACP -> System -> Advanced Configuration, as needed.

There are multiple files (some are libraries with 1000s of line of code and some is custom code written internally).

Merging all of them in a single file manually is not ideal for me.

Is it possible to keep thems separate in dev environtment and merge them in a single file automatically in production?

Link to comment
Share on other sites

5 minutes ago, VarunAgw said:

There are multiple files (some are libraries with 1000s of line of code and some is custom code written internally).

Merging all of them in a single file manually is not ideal for me.

Is it possible to keep thems separate in dev environtment and merge them in a single file automatically in production?

That would be up to you how you wish to handle this as it would not be handle via our software. 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...