| 
									
										
										
										
											2022-04-23 00:42:11 +02:00
										 |  |  | import commonjs from '@rollup/plugin-commonjs'; | 
					
						
							| 
									
										
										
										
											2022-05-13 23:18:19 +02:00
										 |  |  | import json from '@rollup/plugin-json'; | 
					
						
							| 
									
										
										
										
											2022-04-23 00:42:11 +02:00
										 |  |  | import { nodeResolve } from '@rollup/plugin-node-resolve'; | 
					
						
							|  |  |  | import replace from '@rollup/plugin-replace'; | 
					
						
							|  |  |  | import typescript from '@rollup/plugin-typescript'; | 
					
						
							|  |  |  | import { defineConfig } from 'rollup'; | 
					
						
							| 
									
										
										
										
											2022-05-25 21:34:31 +02:00
										 |  |  | import importAssets from 'rollup-plugin-import-assets'; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | import { name } from "./plugin.json"; | 
					
						
							| 
									
										
										
										
											2022-04-23 00:42:11 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | export default defineConfig({ | 
					
						
							|  |  |  |   input: './src/index.tsx', | 
					
						
							|  |  |  |   plugins: [ | 
					
						
							|  |  |  |     commonjs(), | 
					
						
							|  |  |  |     nodeResolve(), | 
					
						
							|  |  |  |     typescript(), | 
					
						
							| 
									
										
										
										
											2022-05-13 23:18:19 +02:00
										 |  |  |     json(), | 
					
						
							| 
									
										
										
										
											2022-04-23 00:42:11 +02:00
										 |  |  |     replace({ | 
					
						
							|  |  |  |       preventAssignment: false, | 
					
						
							|  |  |  |       'process.env.NODE_ENV': JSON.stringify('production'), | 
					
						
							|  |  |  |     }), | 
					
						
							| 
									
										
										
										
											2022-05-25 21:34:31 +02:00
										 |  |  |     importAssets({ | 
					
						
							|  |  |  |       publicPath: `http://127.0.0.1:1337/plugins/${name}/` | 
					
						
							|  |  |  |     }) | 
					
						
							| 
									
										
										
										
											2022-04-23 00:42:11 +02:00
										 |  |  |   ], | 
					
						
							|  |  |  |   context: 'window', | 
					
						
							| 
									
										
										
										
											2023-06-03 07:42:27 -07:00
										 |  |  |   external: ["react", "react-dom", "decky-frontend-lib"], | 
					
						
							| 
									
										
										
										
											2022-04-23 00:42:11 +02:00
										 |  |  |   output: { | 
					
						
							| 
									
										
										
										
											2023-06-03 07:42:27 -07:00
										 |  |  |     file: "dist/index.js", | 
					
						
							| 
									
										
										
										
											2022-04-23 00:42:11 +02:00
										 |  |  |     globals: { | 
					
						
							| 
									
										
										
										
											2023-06-03 07:42:27 -07:00
										 |  |  |       react: "SP_REACT", | 
					
						
							|  |  |  |       "react-dom": "SP_REACTDOM", | 
					
						
							|  |  |  |       "decky-frontend-lib": "DFL" | 
					
						
							| 
									
										
										
										
											2022-04-23 00:42:11 +02:00
										 |  |  |     }, | 
					
						
							|  |  |  |     format: 'iife', | 
					
						
							|  |  |  |     exports: 'default', | 
					
						
							|  |  |  |   }, | 
					
						
							|  |  |  | }); |