MCPcopy Create free account
hub / github.com/ReactTooltip/react-tooltip / ensureFixtureBundle

Function ensureFixtureBundle

benchmarks/run-benchmark.mjs:145–175  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

143}
144
145async function ensureFixtureBundle() {
146 await mkdir(cacheDir, { recursive: true })
147
148 await esbuild.build({
149 entryPoints: [fixtureEntryPath],
150 outfile: fixtureBundlePath,
151 bundle: true,
152 format: 'iife',
153 sourcemap: false,
154 platform: 'browser',
155 alias: {
156 react: rootReactPath,
157 'react-dom': rootReactDomPath,
158 },
159 jsx: 'transform',
160 jsxFactory: 'React.createElement',
161 jsxFragment: 'React.Fragment',
162 loader: {
163 '.js': 'jsx',
164 '.ts': 'ts',
165 '.tsx': 'tsx',
166 },
167 })
168
169 const html = await readFile(fixtureHtmlPath, 'utf8')
170 await writeFile(
171 cacheHtmlPath,
172 html.replace('<script type="module" src="/app.js"></script>', ''),
173 'utf8',
174 )
175}
176
177async function main() {
178 logProgress('Preparing benchmark bundle')

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected