UNPKG

techor

Version:

Author technology like a top leader

44 lines (41 loc) 1.27 kB
import { m as mainExports } from '../_virtual/main.mjs'; function esbuildTransform(options) { return { name: 'techor-esbuild-transform', async renderChunk (code, _, normalizedOutputOptions) { let sourcemap; let format; switch(normalizedOutputOptions.format){ case 'es': format = 'esm'; break; case 'iife': format = 'iife'; break; default: format = 'cjs'; } switch(normalizedOutputOptions.sourcemap){ case 'inline': sourcemap = 'inline'; break; case true: sourcemap = 'external'; break; case false: sourcemap = false; break; default: sourcemap = true; } return await mainExports.transform(code, { format, loader: 'js', minify: true, sourcemap, ...options }); } }; } export { esbuildTransform as default };