MCPcopy
hub / github.com/mathuo/dockview / createBundle

Function createBundle

packages/dockview-react/rollup.config.js:46–123  ·  view source on GitHub ↗
(format, options)

Source from the content-addressed store, hash-verified

44}
45
46function 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

Callers 1

rollup.config.jsFile · 0.70

Calls 3

pushMethod · 0.80
getInputFunction · 0.70
outputFileFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…