问题
There are many components that still require JQuery that I need to use (unfortunately).
What is the best way to do this in Svelte/Sapper? Should I use ES6 Imports, modify rollup, or what is the best approach?
For example, I need to include a pivot table, grid, scheduler, etc from DevExpress or Kendo UI.
I can pull in JQuery globally in the template.html file and get things to work, but I'm sure this is not the best way.
回答1:
Including it as a <script>
in template.html is fine. Alternatively, do
import jQuery from 'jquery';
in any components or modules that use it.
来源:https://stackoverflow.com/questions/57792330/how-to-include-jquery-in-a-svelte-sapper-application