MCPcopy Create free account
hub / github.com/developit/optimize-plugin / renderChunk

Function renderChunk

src/lib/rollup-plugin-terser-simple.js:23–43  ·  view source on GitHub ↗
(source, chunk, options)

Source from the content-addressed store, hash-verified

21 return {
22 name: 'rollup-plugin-terser-simple',
23 async renderChunk (source, chunk, options) {
24 const { code, map } = await terser.minify(source, {
25 compress: {
26 global_defs: {
27 'typeof self': '"object"',
28 'globalThis': 'undefined'
29 },
30 pure_getters: true,
31 unsafe: true
32 },
33 mangle: true,
34 toplevel: true,
35 sourceMap: options.sourcemap && {
36 filename: chunk.fileName
37 }
38 });
39 return {
40 code,
41 map: toBabelMap(map)
42 };
43 }
44 };
45}

Callers

nothing calls this directly

Calls 1

toBabelMapFunction · 0.90

Tested by

no test coverage detected