mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 10:26:08 +01:00 
			
		
		
		
	build(copy-dist): consolidate nodeModules copying into a single loop
This commit is contained in:
		
				
					committed by
					
						 Panagiotis Papadopoulos
						Panagiotis Papadopoulos
					
				
			
			
				
	
			
			
			
						parent
						
							a816abb372
						
					
				
				
					commit
					d75cf8c11e
				
			| @@ -53,7 +53,7 @@ const copy = async () => { | |||||||
|         fs.copySync(dir, path.join(PUBLIC_DIR, path.basename(dir))); |         fs.copySync(dir, path.join(PUBLIC_DIR, path.basename(dir))); | ||||||
|     } |     } | ||||||
|  |  | ||||||
|     const nodeModulesFile = [ |     const nodeModulesFile = new Set([ | ||||||
|         "node_modules/react/umd/react.production.min.js", |         "node_modules/react/umd/react.production.min.js", | ||||||
|         "node_modules/react/umd/react.development.js", |         "node_modules/react/umd/react.development.js", | ||||||
|         "node_modules/react-dom/umd/react-dom.production.min.js", |         "node_modules/react-dom/umd/react-dom.production.min.js", | ||||||
| @@ -63,13 +63,9 @@ const copy = async () => { | |||||||
|         "node_modules/katex/dist/contrib/auto-render.min.js", |         "node_modules/katex/dist/contrib/auto-render.min.js", | ||||||
|         "node_modules/@highlightjs/cdn-assets/highlight.min.js", |         "node_modules/@highlightjs/cdn-assets/highlight.min.js", | ||||||
|         "node_modules/@mind-elixir/node-menu/dist/node-menu.umd.cjs" |         "node_modules/@mind-elixir/node-menu/dist/node-menu.umd.cjs" | ||||||
|     ]; |     ]); | ||||||
|  |  | ||||||
|     for (const file of nodeModulesFile) { |     const nodeModulesFolder = new Set([ | ||||||
|         copyNodeModuleFileOrFolder(file); |  | ||||||
|     } |  | ||||||
|  |  | ||||||
|     const nodeModulesFolder = [ |  | ||||||
|         "node_modules/@excalidraw/excalidraw/dist/", |         "node_modules/@excalidraw/excalidraw/dist/", | ||||||
|         "node_modules/katex/dist/", |         "node_modules/katex/dist/", | ||||||
|         "node_modules/dayjs/", |         "node_modules/dayjs/", | ||||||
| @@ -96,10 +92,12 @@ const copy = async () => { | |||||||
|         "node_modules/@highlightjs/cdn-assets/languages", |         "node_modules/@highlightjs/cdn-assets/languages", | ||||||
|         "node_modules/@highlightjs/cdn-assets/styles", |         "node_modules/@highlightjs/cdn-assets/styles", | ||||||
|         "node_modules/leaflet/dist" |         "node_modules/leaflet/dist" | ||||||
|     ]; |     ]); | ||||||
|  |  | ||||||
|     for (const folder of nodeModulesFolder) { |  | ||||||
|         copyNodeModuleFileOrFolder(folder); |  | ||||||
|  |     for (const nodeModuleItem of [...nodeModulesFile, ...nodeModulesFolder]) { | ||||||
|  |         copyNodeModuleFileOrFolder(nodeModuleItem); | ||||||
|     } |     } | ||||||
| }; | }; | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user