1
0
Fork 0
forked from forgejo/forgejo

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.
This commit is contained in:
silverwind 2023-07-17 20:06:37 +02:00 committed by GitHub
parent d0a9456c4f
commit 8bb0a03eaa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 7 deletions

View file

@ -0,0 +1,4 @@
export async function createSortable(...args) {
const {Sortable} = await import(/* webpackChunkName: "sortablejs" */'sortablejs');
return new Sortable(...args);
}