(file: string, format: 'cjs' | 'es')
| 270 | }) { |
| 271 | await Promise.all([runBuild(cjs, 'cjs'), runBuild(es, 'es')]) |
| 272 | async function runBuild(file: string, format: 'cjs' | 'es') { |
| 273 | const isEsm = format === 'es' |
| 274 | const plugins = getPlugins(name, { |
| 275 | isEsm, |
| 276 | replaceReactShim: isEsm, |
| 277 | }) |
| 278 | const pluginList = [ |
| 279 | plugins.resolve, |
| 280 | plugins.json, |
| 281 | plugins.babel, |
| 282 | plugins.terser, |
| 283 | plugins.analyzer, |
| 284 | plugins.analyzerJSON, |
| 285 | ] |
| 286 | const build = await rollup({ |
| 287 | onwarn, |
| 288 | input: dir(`packages/${name}/scope.ts`), |
| 289 | external: externals, |
| 290 | plugins: pluginList, |
| 291 | }) |
| 292 | await build.write({ |
| 293 | file, |
| 294 | format, |
| 295 | freeze: false, |
| 296 | name, |
| 297 | sourcemap: true, |
| 298 | sourcemapPathTransform: getSourcemapPathTransform(name), |
| 299 | externalLiveBindings: isEsm, |
| 300 | }) |
| 301 | } |
| 302 | } |
| 303 | } |
| 304 |
no test coverage detected
searching dependent graphs…