(format, options)
| 44 | } |
| 45 | |
| 46 | function createBundle(format, options) { |
| 47 | const { withStyles, isMinified } = options; |
| 48 | const input = getInput(options); |
| 49 | const file = outputFile(format, isMinified, withStyles); |
| 50 | |
| 51 | const isUMD = format === 'umd'; |
| 52 | |
| 53 | // dockview (and its transitive dockview-core) are published packages: |
| 54 | // externalize them in the package builds so a consumer ends up with a |
| 55 | // single shared instance (one module registry, one DockviewComponent |
| 56 | // identity), but inline them in the UMD bundle so the CDN build is |
| 57 | // self-contained. |
| 58 | const external = isUMD |
| 59 | ? ['react', 'react-dom'] |
| 60 | : [ |
| 61 | 'react', |
| 62 | 'react-dom', |
| 63 | 'dockview', |
| 64 | /^dockview\//, |
| 65 | 'dockview-core', |
| 66 | /^dockview-core\//, |
| 67 | ]; |
| 68 | |
| 69 | const output = { |
| 70 | file, |
| 71 | format, |
| 72 | // Emit the `__esModule` marker so interop-sensitive consumers (e.g. |
| 73 | // SystemJS, legacy AMD loaders) see the named exports. |
| 74 | esModule: true, |
| 75 | sourcemap: isMinified && format === 'umd', |
| 76 | globals: {}, |
| 77 | banner: [ |
| 78 | `/**`, |
| 79 | ` * ${name}`, |
| 80 | ` * @version ${version}`, |
| 81 | ` * @link ${homepage}`, |
| 82 | ` * @license ${license}`, |
| 83 | ` */`, |
| 84 | ].join('\n'), |
| 85 | }; |
| 86 | |
| 87 | const plugins = [ |
| 88 | nodeResolve({ |
| 89 | include: isUMD |
| 90 | ? [ |
| 91 | 'node_modules/dockview/**', |
| 92 | 'node_modules/dockview-core/**', |
| 93 | ] |
| 94 | : [], |
| 95 | }), |
| 96 | typescript({ |
| 97 | tsconfig: 'tsconfig.esm.json', |
| 98 | outDir: outputDir, |
| 99 | declaration: false, |
| 100 | declarationMap: false, |
| 101 | }), |
| 102 | ]; |
| 103 |
no test coverage detected
searching dependent graphs…