()
| 197 | } |
| 198 | |
| 199 | function externalizeDepsInWatchPlugin(): Plugin { |
| 200 | return { |
| 201 | name: 'externalize-deps-in-watch', |
| 202 | options(options) { |
| 203 | if (this.meta.watchMode) { |
| 204 | options.external ||= [] |
| 205 | if (!Array.isArray(options.external)) |
| 206 | throw new Error('external must be an array') |
| 207 | options.external = options.external.concat( |
| 208 | Object.keys(pkg.devDependencies), |
| 209 | ) |
| 210 | } |
| 211 | }, |
| 212 | } |
| 213 | } |
| 214 | |
| 215 | interface ShimOptions { |
| 216 | src?: string |