MCPcopy Index your code
hub / github.com/rrweb-io/rrweb / buildFile

Function buildFile

vite.config.default.ts:87–122  ·  view source on GitHub ↗
({
  name,
  input,
  output,
  minify,
  isCss,
  outDir,
}: {
  name?: LibraryOptions['name'];
  input: string;
  output: string;
  outDir: string;
  minify: boolean;
  isCss: boolean;
})

Source from the content-addressed store, hash-verified

85}
86
87async function buildFile({
88 name,
89 input,
90 output,
91 minify,
92 isCss,
93 outDir,
94}: {
95 name?: LibraryOptions['name'];
96 input: string;
97 output: string;
98 outDir: string;
99 minify: boolean;
100 isCss: boolean;
101}) {
102 await build({
103 entryPoints: [input],
104 outfile: output,
105 minify,
106 sourcemap: true,
107 format: isCss ? undefined : ('umd' as Format),
108 target: isCss ? undefined : 'es2017',
109 treeShaking: !isCss,
110 plugins: [
111 umdWrapper({
112 libraryName: name,
113 }),
114 ],
115 });
116 const filename = output.replace(
117 new RegExp(`^.+[/\\\\](${outDir}[/\\\\])`),
118 '$1',
119 );
120 console.log(filename);
121 console.log(`${filename}.map`);
122}
123
124export default function (
125 entry: LibraryOptions['entry'],

Callers 1

writeBundleFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected