0
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-28 08:28:40 +01:00
gitea/web_src/js/modules/sortable.js
silverwind 8bb0a03eaa
Import sortablejs only once (#25936)
Previously, `sortablejs` was imported twice, once synchronously and once
asynchronously, leading to webpack creating duplicate output code (once
in the index bundle, and once in a separate chunk). Fix this by always
asynchronously importing it. This was one of the build warnings observed
when trying to build with vite.
2023-07-17 18:06:37 +00:00

5 lines
167 B
JavaScript

export async function createSortable(...args) {
const {Sortable} = await import(/* webpackChunkName: "sortablejs" */'sortablejs');
return new Sortable(...args);
}