MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / build

Function build

packages/ui-default/backendlib/builder.ts:63–88  ·  view source on GitHub ↗
(contents: string)

Source from the content-addressed store, hash-verified

61};
62
63const build = async (contents: string) => {
64 const res = await esbuild.build({
65 tsconfigRaw: '{"compilerOptions":{"experimentalDecorators":true}}',
66 format: 'iife' as 'iife',
67 bundle: true,
68 outdir: tmp,
69 sourcemap: SystemModel.get('ui-default.nosourcemap') ? false : 'external',
70 splitting: false,
71 write: false,
72 target: ['chrome65'],
73 plugins: [
74 ...(global.Hydro.ui.esbuildPlugins || []),
75 federationPlugin,
76 ],
77 minify: !process.env.DEV,
78 stdin: {
79 contents,
80 sourcefile: 'stdin.ts',
81 resolveDir: tmp,
82 loader: 'ts',
83 },
84 });
85 if (res.errors.length) console.error(res.errors);
86 if (res.warnings.length) console.warn(res.warnings);
87 return res;
88};
89
90const applyCss = (css: string) => `
91 const style = document.createElement('style');

Callers 1

buildUIFunction · 0.85

Calls 3

getMethod · 0.45
errorMethod · 0.45
warnMethod · 0.45

Tested by

no test coverage detected