One JS with all Plugins and Features #847
-
Hi, i have a Question. For some Tables with additional Features i need to import a lot of JS files like this example:
and for an other Table on the Same Page i need again this one:
So there are alot of JS files to import. My Question: is there a ALLSLICK.JS or ALLSLICKPLUNGINS.JS ... something like that? thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Usually web developers use a bundling and minification tool to handle all of this stuff. You don't have bundling as part of your stack? |
Beta Was this translation helpful? Give feedback.
-
Well if you use the new ESM import then it's 1 import, see Example 4 - ESM which is in vanilla JS and just requires you to use As for the old browser ( Actually now that I think of it, you could create your own "all-in-one" bundle, you just need to move these imports into an external JS file that you can reuse and then load this custom "all-in-one" JS file into your project. That way you could customize it to your need and only include what you want. |
Beta Was this translation helpful? Give feedback.
Well if you use the new ESM import then it's 1 import, see Example 4 - ESM which is in vanilla JS and just requires you to use
<script type="module">
As for the old browser (
iife
) imports, that will not change, you still need to import multiple files and we do not expect to ever change it because it is still a good way to only import what you want/use and that is what SlickGrid users have been using and loading in their pages for the past 10 years. For example, if we merged everything into 1 bundle, you would be loading the entire libraries with all controls & plugins and you must probably will never use them all in most cases. Again it's recommended to use the new ESM import (which is bu…