mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-04 01:34:27 +00:00 
			
		
		
		
	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:
		
							
								
								
									
										4
									
								
								web_src/js/modules/sortable.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								web_src/js/modules/sortable.js
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,4 @@
 | 
			
		||||
export async function createSortable(...args) {
 | 
			
		||||
  const {Sortable} = await import(/* webpackChunkName: "sortablejs" */'sortablejs');
 | 
			
		||||
  return new Sortable(...args);
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user