(name: string)
| 447 | }) |
| 448 | } |
| 449 | async function createCompat(name: string) { |
| 450 | const plugins = getPlugins(`${name}.compat`) |
| 451 | |
| 452 | const {getAliases} = require('../babel.config') |
| 453 | const terserConfig = minifyConfig({ |
| 454 | beautify: !!process.env.PRETTIFY, |
| 455 | }) |
| 456 | const pluginList = [ |
| 457 | plugins.resolve, |
| 458 | plugins.json, |
| 459 | babel({ |
| 460 | babelHelpers: 'bundled', |
| 461 | extensions, |
| 462 | skipPreflightCheck: true, |
| 463 | exclude: /node_modules.*/, |
| 464 | babelrc: false, |
| 465 | presets: [ |
| 466 | [ |
| 467 | '@babel/preset-typescript', |
| 468 | { |
| 469 | isTSX: true, |
| 470 | allExtensions: true, |
| 471 | }, |
| 472 | ], |
| 473 | ['@babel/preset-react', {useBuiltIns: false}], |
| 474 | [ |
| 475 | '@babel/preset-env', |
| 476 | { |
| 477 | loose: true, |
| 478 | useBuiltIns: 'entry', |
| 479 | corejs: 3, |
| 480 | modules: false, |
| 481 | shippedProposals: true, |
| 482 | targets: compatTarget, |
| 483 | }, |
| 484 | ], |
| 485 | ], |
| 486 | plugins: [ |
| 487 | '@babel/plugin-transform-export-namespace-from', |
| 488 | '@babel/plugin-transform-optional-chaining', |
| 489 | '@babel/plugin-transform-nullish-coalescing-operator', |
| 490 | ['@babel/plugin-transform-class-properties', {loose: true}], |
| 491 | [ |
| 492 | 'babel-plugin-module-resolver', |
| 493 | { |
| 494 | alias: getAliases({ |
| 495 | isBuild: true, |
| 496 | isTest: false, |
| 497 | isCompat: true, |
| 498 | isEsm: false, |
| 499 | }), |
| 500 | loglevel: 'silent', |
| 501 | }, |
| 502 | ], |
| 503 | ], |
| 504 | }), |
| 505 | plugins.commonjs, |
| 506 | terser({ |
no test coverage detected
searching dependent graphs…