| 
									
										
										
										
											2024-09-27 17:00:13 +08:00
										 |  |  | import { createRequire } from 'node:module'; | 
					
						
							| 
									
										
										
										
											2023-10-13 20:11:41 +08:00
										 |  |  | import copy from 'rollup-plugin-copy'; | 
					
						
							| 
									
										
										
										
											2024-03-22 22:46:32 +08:00
										 |  |  | import svg from 'rollup-plugin-svg-import'; | 
					
						
							| 
									
										
										
										
											2023-10-13 20:11:41 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-25 16:11:09 +08:00
										 |  |  | import { cjsOutput, entryPoint, esmOutput, plugins, tsDeclarationOutput } from '../rollup.config.parts'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-09-27 17:00:13 +08:00
										 |  |  | const rq = createRequire(import.meta.url); | 
					
						
							|  |  |  | const icons = rq('../../public/app/core/icons/cached.json'); | 
					
						
							|  |  |  | const pkg = rq('./package.json'); | 
					
						
							| 
									
										
										
										
											2019-02-21 17:58:28 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2023-10-13 20:11:41 +08:00
										 |  |  | const iconSrcPaths = icons.map((iconSubPath) => { | 
					
						
							|  |  |  |   return `../../public/img/icons/${iconSubPath}.svg`; | 
					
						
							|  |  |  | }); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2022-08-03 21:47:09 +08:00
										 |  |  | export default [ | 
					
						
							|  |  |  |   { | 
					
						
							| 
									
										
										
										
											2025-02-25 16:11:09 +08:00
										 |  |  |     input: entryPoint, | 
					
						
							| 
									
										
										
										
											2023-10-13 20:11:41 +08:00
										 |  |  |     plugins: [ | 
					
						
							| 
									
										
										
										
											2025-02-25 16:11:09 +08:00
										 |  |  |       ...plugins, | 
					
						
							| 
									
										
										
										
											2024-03-22 22:46:32 +08:00
										 |  |  |       svg({ stringify: true }), | 
					
						
							| 
									
										
										
										
											2023-10-13 20:11:41 +08:00
										 |  |  |       copy({ | 
					
						
							|  |  |  |         targets: [{ src: iconSrcPaths, dest: './dist/public/' }], | 
					
						
							|  |  |  |         flatten: false, | 
					
						
							|  |  |  |       }), | 
					
						
							|  |  |  |     ], | 
					
						
							| 
									
										
										
										
											2025-02-25 16:11:09 +08:00
										 |  |  |     output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-ui')], | 
					
						
							| 
									
										
										
										
											2022-08-03 21:47:09 +08:00
										 |  |  |   }, | 
					
						
							| 
									
										
										
										
											2025-03-04 16:55:41 +08:00
										 |  |  |   { | 
					
						
							|  |  |  |     input: 'src/unstable.ts', | 
					
						
							|  |  |  |     plugins: [ | 
					
						
							|  |  |  |       ...plugins, | 
					
						
							|  |  |  |       svg({ stringify: true }), | 
					
						
							|  |  |  |       copy({ | 
					
						
							|  |  |  |         targets: [{ src: iconSrcPaths, dest: './dist/public/' }], | 
					
						
							|  |  |  |         flatten: false, | 
					
						
							|  |  |  |       }), | 
					
						
							|  |  |  |     ], | 
					
						
							|  |  |  |     output: [cjsOutput(pkg), esmOutput(pkg, 'grafana-ui')], | 
					
						
							|  |  |  |   }, | 
					
						
							| 
									
										
										
										
											2025-02-25 16:11:09 +08:00
										 |  |  |   tsDeclarationOutput(pkg), | 
					
						
							| 
									
										
										
										
											2025-03-04 16:55:41 +08:00
										 |  |  |   tsDeclarationOutput(pkg, { | 
					
						
							|  |  |  |     input: './compiled/unstable.d.ts', | 
					
						
							|  |  |  |     output: [ | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         file: './dist/cjs/unstable.d.cts', | 
					
						
							|  |  |  |         format: 'cjs', | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |       { | 
					
						
							|  |  |  |         file: './dist/esm/unstable.d.mts', | 
					
						
							|  |  |  |         format: 'es', | 
					
						
							|  |  |  |       }, | 
					
						
							|  |  |  |     ], | 
					
						
							|  |  |  |   }), | 
					
						
							| 
									
										
										
										
											2022-08-03 21:47:09 +08:00
										 |  |  | ]; |